 package scripting;


import client.*;
import client.inventory.*;
import client.skills.Skill;
import client.skills.SkillFactory;
import com.alibaba.druid.pool.DruidPooledConnection;
import configs.ServerConfig;
import constants.GameConstants;
import constants.ItemConstants;
import constants.JobConstants;
import constants.ServerConstants;
import database.DatabaseConnection;
import database.DatabaseScriptAPI;
import handling.channel.ChannelServer;
import handling.channel.handler.InterServerHandler;
import handling.opcode.BossEffectOpcode;
import handling.opcode.EffectOpcode;
import handling.opcode.FieldEffectOpcode;
import handling.opcode.SendPacketOpcode;
import handling.world.WorldBroadcastService;
import handling.world.WorldGuildService;
import handling.world.WorldPartyService;
import handling.world.guild.MapleGuild;
import handling.world.party.MapleParty;
import handling.world.party.MaplePartyCharacter;
import net.sf.json.JSONObject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import scripting.event.EventInstanceManager;
import scripting.event.EventManager;
import scripting.event.EventScriptManager;
import scripting.map.MapScriptMethods;
import scripting.npc.NPCScriptManager;
import server.*;
import server.Timer;
import server.events.DimensionalMirror;
import server.events.MapleDojoAgent;
import server.events.MapleEvent;
import server.events.MapleEventType;
import server.life.*;
import server.maps.*;
import server.quest.MapleQuest;
import server.reward.StarReward;
import tools.*;
import tools.data.output.MaplePacketLittleEndianWriter;
import tools.packet.*;
import tools.packet.effect.LP_FieldEffect;
import tools.packet.effect.LP_UserEffectLocal;

import java.awt.*;
import java.lang.ref.WeakReference;
import java.sql.*;
import java.util.*;
import java.util.List;


 public abstract class AbstractPlayerInteraction {
/*   59 */   public static final Logger log = LogManager.getLogger(AbstractPlayerInteraction.class);
/*   60 */   private static final Map<Pair, MapleNPC> npcs = new WeakHashMap<>();
   protected final WeakReference c;
   protected final int id;
   protected final String id2;
   private byte byte1;
   private int int1;
   private int int2;

   public AbstractPlayerInteraction(MapleClient c) {
/*   69 */     this.c = new WeakReference<>(c);
/*   70 */     this.id = 0;
/*   71 */     this.id2 = "";
   }

   public AbstractPlayerInteraction(MapleClient c, int id, String id2) {
/*   75 */     this.c = new WeakReference<>(c);
/*   76 */     this.id = id;
/*   77 */     this.id2 = id2;
   }






   public MapleClient getClient() {
/*   86 */     return (MapleClient)this.c.get();
   }






   public MapleClient getC() {
/*   95 */     return (MapleClient)this.c.get();
   }






   public MapleCharacter getChar() {
/*  104 */     return getClient().getPlayer();
   }






   public MapleCharacter getPlayer() {
/*  113 */     return getClient().getPlayer();
   }







   public MapleCharacter getCharacterById(int charId) {
/*  123 */     return getChannelServer().getPlayerStorage().getCharacterById(charId);
   }







   public List<MapleCharacter> getCharacterListById(int[] charIds) {
/*  133 */     List<MapleCharacter> characters = new ArrayList<>();
/*  134 */     for (int charId : charIds) {
/*  135 */       characters.add(getChannelServer().getPlayerStorage().getCharacterById(charId));
     }
/*  137 */     return characters;
   }






   public int getPosX() {
/*  146 */     return (getClient().getPlayer().getTruePosition()).x;
   }






   public int getPosY() {
/*  155 */     return (getClient().getPlayer().getTruePosition()).y;
   }




   public ChannelServer getChannelServer() {
/*  162 */     return getClient().getChannelServer();
   }

   public EventManager getEventManager(String event) {
/*  166 */     return getClient().getChannelServer().getEventSM().getEventManager(event);
   }

   public EventInstanceManager getEventInstance() {
/*  170 */     return getClient().getPlayer().getEventInstance();
   }






   public void warp(int mapId) {
/*  179 */     MapleMap mapz = getWarpMap(mapId);
/*  180 */     if (mapz == null) {
/*  181 */       playerMessage(1, "不存在的地图ID:" + mapId + "\r\n请联系管理员删除该地图传送");
       return;
     }
     try {
/*  185 */       getClient().getPlayer().changeMap(mapz, mapz.getPortalSP().get(nextInt(mapz.getPortalSP().size())));
/*  186 */     } catch (Exception e) {
/*  187 */       getClient().getPlayer().changeMap(mapz, mapz.getPortal(0));
     }
   }

   public void warp_Instanced(int mapId) {
/*  192 */     MapleMap mapz = getMap_Instanced(mapId);
     try {
/*  194 */       getClient().getPlayer().changeMap(mapz, mapz.getPortalSP().get(nextInt(mapz.getPortalSP().size())));
/*  195 */     } catch (Exception e) {
/*  196 */       getClient().getPlayer().changeMap(mapz, mapz.getPortal(0));
     }
   }

   public void warp(int mapId, int portal) {
/*  201 */     MapleMap mapz = getWarpMap(mapId);
/*  202 */     if (portal != 0 && mapId == getClient().getPlayer().getMapId()) {
/*  203 */       Point portalPos = new Point(getClient().getPlayer().getMap().getPortal(portal).getPosition());
/*  204 */       if (portalPos.distanceSq(getPlayer().getTruePosition()) < 90000.0D) {
/*  205 */         instantMapWarp((byte)portal);
/*  206 */         getPlayer().checkFollow();
/*  207 */         getMap().movePlayer(getClient().getPlayer(), portalPos);
       } else {
/*  209 */         getPlayer().changeMap(mapz, mapz.getPortal(portal));
       }
     } else {
/*  212 */       getPlayer().changeMap(mapz, mapz.getPortal(portal));
     }
   }

   public void warpS(int mapId, int portal) {
/*  217 */     MapleMap mapz = getWarpMap(mapId);
/*  218 */     getClient().getPlayer().changeMap(mapz, mapz.getPortal(portal));
   }

   public void warp(int mapId, String portal) {
/*  222 */     MapleMap mapz = getWarpMap(mapId);
/*  223 */     if (mapId == 109060000 || mapId == 109060002 || mapId == 109060004) {
/*  224 */       portal = mapz.getSnowballPortal();
     }
/*  226 */     if (mapId == getClient().getPlayer().getMapId()) {
/*  227 */       MaplePortal portalPos = getClient().getPlayer().getMap().getPortal(portal);
/*  228 */       if (portalPos != null && portalPos.getPosition().distanceSq(getPlayer().getTruePosition()) < 90000.0D) {
/*  229 */         getClient().getPlayer().checkFollow();
/*  230 */         instantMapWarp((byte)portalPos.getId());
/*  231 */         getClient().getPlayer().getMap().movePlayer(getClient().getPlayer(), portalPos.getPosition());
       } else {
/*  233 */         getClient().getPlayer().changeMap(mapz, mapz.getPortal(portal));
       }
     } else {
/*  236 */       getClient().getPlayer().changeMap(mapz, mapz.getPortal(portal));
     }
   }

   public void warpS(int mapId, String portal) {
/*  241 */     MapleMap mapz = getWarpMap(mapId);
/*  242 */     if (mapId == 109060000 || mapId == 109060002 || mapId == 109060004) {
/*  243 */       portal = mapz.getSnowballPortal();
     }
/*  245 */     getClient().getPlayer().changeMap(mapz, mapz.getPortal(portal));
   }

   public void warpMap(int mapId, int portal) {
/*  249 */     MapleMap map = getMap(mapId);
/*  250 */     for (MapleCharacter chr : getClient().getPlayer().getMap().getCharactersThreadsafe()) {
/*  251 */       chr.changeMap(map, map.getPortal(portal));
     }
   }

   public void playPortalSE() {
/*  256 */     getClient().announce(EffectPacket.showOwnBuffEffect(0, EffectOpcode.UserEffect_PlayPortalSE.getValue(), 1, 1));
   }

   private MapleMap getWarpMap(int mapId) {
/*  260 */     return ChannelServer.getInstance(getClient().getChannel()).getMapFactory().getMap(mapId);
   }

   public MapleMap getMap() {
/*  264 */     return getClient().getPlayer().getMap();
   }

   public MapleMap getMap(int mapId) {
/*  268 */     return getWarpMap(mapId);
   }

   public MapleMap getMap_Instanced(int mapId) {
/*  272 */     return (getClient().getPlayer().getEventInstance() == null) ? getMap(mapId) : getClient().getPlayer().getEventInstance().getMapInstance(mapId);
   }







   public void spawnMobLevel(int mobId, int level) {
/*  282 */     spawnMobLevel(mobId, 1, level, getClient().getPlayer().getTruePosition());
   }








   public void spawnMobLevel(int mobId, int quantity, int level) {
/*  293 */     spawnMobLevel(mobId, quantity, level, getClient().getPlayer().getTruePosition());
   }










   public void spawnMobLevel(int mobId, int quantity, int level, int x, int y) {
/*  306 */     spawnMobLevel(mobId, quantity, level, new Point(x, y));
   }









   public void spawnMobLevel(int mobId, int quantity, int level, Point pos) {
/*  318 */     for (int i = 0; i < quantity; i++) {
/*  319 */       MapleMonster mob = MapleLifeFactory.getMonster(mobId);
/*  320 */       if (mob == null || !mob.getStats().isChangeable()) {
/*  321 */         if (getClient().getPlayer().isAdmin()) {
/*  322 */           getClient().getPlayer().dropMessage(-11, "[系统提示] spawnMobLevel召唤怪物出错，ID为: " + mobId + " 怪物不存在或者该怪物无法使用这个函数来改变怪物的属性！");
         }
       } else {

/*  326 */         mob.changeLevel(level, false);
/*  327 */         getMap().spawnMonsterOnGroundBelow(mob, pos);
       }
     }
   }







   public void spawnMobStats(int mobId, long newhp, int newExp) {
/*  339 */     spawnMobStats(mobId, 1, newhp, newExp, getPlayer().getTruePosition());
   }









   public void spawnMobStats(int mobId, int quantity, long newhp, int newExp) {
/*  351 */     spawnMobStats(mobId, quantity, newhp, newExp, getPlayer().getTruePosition());
   }











   public void spawnMobStats(int mobId, int quantity, long newhp, int newExp, int x, int y) {
/*  365 */     spawnMobStats(mobId, quantity, newhp, newExp, new Point(x, y));
   }










   public void spawnMobStats(int mobId, int quantity, long newhp, int newExp, Point pos) {
/*  378 */     for (int i = 0; i < quantity; i++) {
/*  379 */       MapleMonster mob = MapleLifeFactory.getMonster(mobId);
/*  380 */       if (mob == null) {
/*  381 */         if (getPlayer().isAdmin()) {
/*  382 */           getPlayer().dropMessage(-11, "[系统提示] spawnMobStats召唤怪物出错，ID为: " + mobId + " 怪物不存在！");
         }
       } else {

/*  386 */         OverrideMonsterStats overrideStats = new OverrideMonsterStats(newhp, mob.getMobMaxMp(), (newExp <= 0) ? mob.getMobExp() : newExp, false);
/*  387 */         mob.setOverrideStats(overrideStats);
/*  388 */         getMap().spawnMonsterOnGroundBelow(mob, pos);
       }
     }
   }






   public void spawnMobMultipler(int mobId, int multipler) {
/*  399 */     spawnMobMultipler(mobId, 1, multipler, getPlayer().getTruePosition());
   }








   public void spawnMobMultipler(int mobId, int quantity, int multipler) {
/*  410 */     spawnMobMultipler(mobId, quantity, multipler, getPlayer().getTruePosition());
   }










   public void spawnMobMultipler(int mobId, int quantity, int multipler, int x, int y) {
/*  423 */     spawnMobMultipler(mobId, quantity, multipler, new Point(x, y));
   }









   public void spawnMobMultipler(int mobId, int quantity, int multipler, Point pos) {
/*  435 */     for (int i = 0; i < quantity; i++) {
/*  436 */       MapleMonster mob = MapleLifeFactory.getMonster(mobId);
/*  437 */       if (mob == null) {
/*  438 */         if (getPlayer().isAdmin()) {
/*  439 */           getPlayer().dropMessage(-11, "[系统提示] spawnMobMultipler召唤怪物出错，ID为: " + mobId + " 怪物不存在！");
         }
       } else {

/*  443 */         OverrideMonsterStats overrideStats = new OverrideMonsterStats(mob.getMobMaxHp() * multipler, mob.getMobMaxMp() * multipler, mob.getMobExp() + multipler * 100, false);
/*  444 */         mob.setOverrideStats(overrideStats);
/*  445 */         getMap().spawnMonsterOnGroundBelow(mob, pos);
       }
     }
   }






   public void spawnMonster(int mobId, int quantity) {
/*  456 */     spawnMob(mobId, quantity, getClient().getPlayer().getTruePosition());
   }










   public void spawnMobOnMap(int mobId, int quantity, int x, int y, int map) {
/*  469 */     for (int i = 0; i < quantity; i++) {
/*  470 */       getMap(map).spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(x, y));
     }
   }









   public void spawnMob(int mobId, int quantity, int x, int y) {
/*  483 */     spawnMob(mobId, quantity, new Point(x, y));
   }








   public void spawnMob(int mobId, int x, int y) {
/*  494 */     spawnMob(mobId, 1, new Point(x, y));
   }








   private void spawnMob(int mobId, int quantity, Point pos) {
/*  505 */     for (int i = 0; i < quantity; i++) {
/*  506 */       getClient().getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), pos);
     }
   }






   public void killMob(int mobId) {
/*  516 */     getClient().getPlayer().getMap().killMonster(mobId);
   }




   public void killAllMob() {
/*  523 */     getClient().getPlayer().getMap().killAllMonsters(true);
   }






   public void addHP(int delta) {
/*  532 */     getClient().getPlayer().addHP(delta);
   }







   public int getPlayerStat(String type) {
/*  542 */     switch (type) {
       case "LVL":
/*  544 */         return getClient().getPlayer().getLevel();
       case "STR":
/*  546 */         return getClient().getPlayer().getStat().getStr();
       case "DEX":
/*  548 */         return getClient().getPlayer().getStat().getDex();
       case "INT":
/*  550 */         return getClient().getPlayer().getStat().getInt();
       case "LUK":
/*  552 */         return getClient().getPlayer().getStat().getLuk();
       case "HP":
/*  554 */         return getClient().getPlayer().getStat().getHp();
       case "MP":
/*  556 */         return getClient().getPlayer().getStat().getMp();
       case "MAXHP":
/*  558 */         return getClient().getPlayer().getStat().getMaxHp();
       case "MAXMP":
/*  560 */         return getClient().getPlayer().getStat().getMaxMp();
       case "RAP":
/*  562 */         return getClient().getPlayer().getRemainingAp();
       case "RSP":
/*  564 */         return getClient().getPlayer().getRemainingSp();
       case "GID":
/*  566 */         return getClient().getPlayer().getGuildId();
       case "GRANK":
/*  568 */         return getClient().getPlayer().getGuildRank();
       case "ARANK":
/*  570 */         return getClient().getPlayer().getAllianceRank();
       case "GM":
/*  572 */         return getClient().getPlayer().isGM() ? 1 : 0;
       case "ADMIN":
/*  574 */         return getClient().getPlayer().isAdmin() ? 1 : 0;
       case "GENDER":
/*  576 */         return getClient().getPlayer().getGender();
       case "FACE":
/*  578 */         return getClient().getPlayer().getFace();
       case "HAIR":
/*  580 */         return getClient().getPlayer().getHair();
     }
/*  582 */     return -1;
   }







   public int getAndroidStat(String type) {
/*  592 */     switch (type) {
       case "HAIR":
/*  594 */         return getClient().getPlayer().getAndroid().getHair();
       case "FACE":
/*  596 */         return getClient().getPlayer().getAndroid().getFace();
       case "SKIN":
/*  598 */         return getClient().getPlayer().getAndroid().getSkin();
       case "GENDER":
/*  600 */         return getClient().getPlayer().getAndroid().getGender();
     }
/*  602 */     return -1;
   }






   public String getName() {
/*  611 */     return getClient().getPlayer().getName();
   }






   public String getServerName() {
/*  620 */     return getClient().getPlayer().getClient().getChannelServer().getServerName();
   }






   public String getTrueServerName() {
/*  629 */     return getClient().getPlayer().getClient().getChannelServer().getTrueServerName();
   }







   public boolean haveItem(int itemId) {
/*  639 */     return haveItem(itemId, 1);
   }








   public boolean haveItem(int itemId, int quantity) {
/*  650 */     return haveItem(itemId, quantity, false, true);
   }

   public boolean haveItem(int itemId, int quantity, boolean checkEquipped, boolean greaterOrEquals) {
/*  654 */     return getClient().getPlayer().haveItem(itemId, quantity, checkEquipped, greaterOrEquals);
   }







   public int getItemQuantity(int itemId) {
/*  664 */     return getClient().getPlayer().getItemQuantity(itemId);
   }






   public boolean canHold() {
/*  673 */     return getClient().getPlayer().canHold();
   }







   public boolean canHoldSlots(int slot) {
/*  683 */     return getClient().getPlayer().canHoldSlots(slot);
   }







   public boolean canHold(int itemId) {
/*  693 */     return getClient().getPlayer().canHold(itemId);
   }








   public boolean canHold(int itemId, int quantity) {
/*  704 */     return MapleInventoryManipulator.checkSpace(getClient(), itemId, quantity, "");
   }




   public MapleQuestStatus getQuestRecord(int questId) {
/*  711 */     return getClient().getPlayer().getQuestNAdd(MapleQuest.getInstance(questId));
   }

   public MapleQuestStatus getQuestNoRecord(int questId) {
/*  715 */     return getClient().getPlayer().getQuestNoAdd(MapleQuest.getInstance(questId));
   }

   public byte getQuestStatus(int questId) {
/*  719 */     return getClient().getPlayer().getQuestStatus(questId);
   }

   public boolean isQuestActive(int questId) {
/*  723 */     return (getQuestStatus(questId) == 1);
   }







   public boolean isQuestFinished(int questId) {
/*  733 */     return (getQuestStatus(questId) == 2);
   }

   public void showQuestMsg(String msg) {
/*  737 */     getClient().announce(MaplePacketCreator.showQuestMsg(msg));
   }

   public void forceStartQuest(int questId, String data) {
/*  741 */     MapleQuest.getInstance(questId).forceStart(getClient().getPlayer(), 0, data);
   }

   public void forceStartQuest(int questId, int data, boolean filler) {
/*  745 */     MapleQuest.getInstance(questId).forceStart(getClient().getPlayer(), 0, filler ? String.valueOf(data) : null);
   }

   public void forceStartQuest(int questId) {
/*  749 */     MapleQuest.getInstance(questId).forceStart(getClient().getPlayer(), 0, null);
   }

   public void forceCompleteQuest(int questId) {
/*  753 */     MapleQuest.getInstance(questId).forceComplete(getPlayer(), 0);
   }

   public void forceForfeitQuest(int questId) {
/*  757 */     MapleQuest.getInstance(questId).forfeit(getPlayer());
   }

   public String getQuestCustomData(int questId) {
/*  761 */     MapleQuest jq = MapleQuest.getInstance(questId);
/*  762 */     String custom = null;
/*  763 */     if (jq != null) {
/*  764 */       custom = getPlayer().getQuestNAdd(jq).getCustomData();
     }
/*  766 */     return custom;
   }

   public void updateOneQuestInfo(int questid, String key, String value) {
/*  770 */     getPlayer().updateOneQuestInfo(questid, key, value);
   }

   public void updateQuestInfo(int questid, String data) {
/*  774 */     getPlayer().updateQuestInfo(questid, data, true);
   }

   public String getQuestInfo(int questid) {
/*  778 */     return getPlayer().getInfoQuest(questid);
   }

   public String getQuestInfo(int questid, String stat) {
/*  782 */     return getPlayer().getQuestInfo(questid, stat);
   }






   public void spawnNpc(int npcId) {
/*  791 */     getClient().getPlayer().getMap().spawnNpc(npcId, getClient().getPlayer().getPosition());
   }








   public void spawnNpc(int npcId, int x, int y) {
/*  802 */     getClient().getPlayer().getMap().spawnNpc(npcId, new Point(x, y));
   }







   public void spawnNpc(int npcId, Point pos) {
/*  812 */     getClient().getPlayer().getMap().spawnNpc(npcId, pos);
   }







   public void removeNpc(int mapid, int npcId) {
/*  822 */     getClient().getChannelServer().getMapFactory().getMap(mapid).removeNpc(npcId);
   }

   public void removeNpcforQ(int mapid, int npcId) {
/*  826 */     getChannelServer().getMapFactory().getMap(mapid).removeNpc(npcId, getChar().getId());
   }






   public void removeNpc(int npcId) {
/*  835 */     getClient().getPlayer().getMap().removeNpc(npcId);
   }

   public void forceStartReactor(int mapId, int reactorId) {
/*  839 */     MapleMap map = getClient().getChannelServer().getMapFactory().getMap(mapId);


/*  842 */     for (MapleMapObject remo : map.getAllReactorsThreadsafe()) {
/*  843 */       MapleReactor react = (MapleReactor)remo;
/*  844 */       if (react.getReactorId() == reactorId) {
/*  845 */         react.forceStartReactor(getClient());
         break;
       }
     }
   }

   public void destroyReactor(int mapId, int reactorId) {
/*  852 */     MapleMap map = getClient().getChannelServer().getMapFactory().getMap(mapId);


/*  855 */     for (MapleMapObject remo : map.getAllReactorsThreadsafe()) {
/*  856 */       MapleReactor react = (MapleReactor)remo;
/*  857 */       if (react.getReactorId() == reactorId) {
/*  858 */         react.hitReactor(getClient());
         break;
       }
     }
   }

   public void hitReactor(int mapId, int reactorId) {
/*  865 */     MapleMap map = getClient().getChannelServer().getMapFactory().getMap(mapId);


/*  868 */     for (MapleMapObject remo : map.getAllReactorsThreadsafe()) {
/*  869 */       MapleReactor react = (MapleReactor)remo;
/*  870 */       if (react.getReactorId() == reactorId) {
/*  871 */         react.hitReactor(getClient());
         break;
       }
     }
   }

   public int getReactorStat(String s) {
/*  878 */     return getMap().getReactorStat(s);
   }

   public void forceTrigger(int mapId, int reactorId) {
/*  882 */     MapleMap map = getClient().getChannelServer().getMapFactory().getMap(mapId);
/*  883 */     for (MapleReactor reactor : map.getAllReactorsThreadsafe()) {
/*  884 */       if (reactor.getReactorId() == reactorId) {
/*  885 */         reactor.setState((byte)1);
/*  886 */         reactor.forceTrigger();
         break;
       }
     }
   }

   public void forceTrigger(String name, int state) {
/*  893 */     getMap().forceTrigger(name, (byte)state);
   }

   public void forceTriggerStateEnd(String s, byte b, byte b2) {
/*  897 */     getMap().forceTriggerStateEnd(s, b, b2);
   }

   public void forceTrigger(int reactorID, byte newState) {
/*  901 */     getMap().forceTrigger(reactorID, newState);
   }

   public void forceTrigger(int mapID, int reactorID, byte newState) {
/*  905 */     MapleMap map = getMap(mapID);
/*  906 */     if (map != null) {
/*  907 */       map.forceTrigger(reactorID, newState);
     }
   }






   public int getJob() {
/*  917 */     return getClient().getPlayer().getJob();
   }






   public int getJobId() {
/*  926 */     return getJob();
   }

   public int getBeginner() {
/*  930 */     return JobConstants.getBeginner((short)getJob());
   }

   public int getTrueJobGrade() {
/*  934 */     return JobConstants.getTrueJobGrade(getJob());
   }







   public String getJobName(int jobId) {
/*  944 */     return JobConstants.getJobNameById(jobId);
   }






   public boolean isBeginnerJob() {
/*  953 */     return (JobConstants.is新手职业(getJob()) && getLevel() < 11);
   }






   public boolean is骑士团() {
/*  962 */     return JobConstants.is骑士团(getJob());
   }






   public int getLevel() {
/*  971 */     return getClient().getPlayer().getLevel();
   }




   public void getLevelup() {
/*  978 */     getPlayer().levelUp();
   }






   public int getFame() {
/*  987 */     return getClient().getPlayer().getFame();
   }






   public void gainFame(int famechange) {
/*  996 */     gainFame(famechange, false);
   }

   public void gainFame(int famechange, boolean show) {
/* 1000 */     getClient().getPlayer().gainFame(famechange, show);
   }







   public int getNX(int type) {
/* 1010 */     return getClient().getPlayer().getCSPoints(type);
   }







   public boolean gainNX(int amount) {
/* 1020 */     return getClient().getPlayer().modifyCSPoints(1, amount, true);
   }








   public boolean gainNX(int type, int amount) {
/* 1031 */     if (type <= 0 || type > 2) {
/* 1032 */       type = 2;
     }
/* 1034 */     return getClient().getPlayer().modifyCSPoints(type, amount, true);
   }








   public void gainItemPeriod(int itemId, short quantity, long period) {
/* 1045 */     gainItem(itemId, quantity, false, period, -1, "", 0);
   }









   public void gainItemPeriod(int itemId, short quantity, long period, String owner) {
/* 1057 */     gainItem(itemId, quantity, false, period, -1, owner, 0);
   }







   public void gainItem(int itemId, short quantity) {
/* 1067 */     gainItem(itemId, quantity, false, 0L, -1, "", 0);
   }








   public void gainItemState(int itemId, short quantity, int state) {
/* 1078 */     gainItem(itemId, quantity, false, 0L, -1, "", state);
   }








   public void gainItem(int itemId, short quantity, boolean randomStats) {
/* 1089 */     gainItem(itemId, quantity, randomStats, 0L, -1, "", 0);
   }








   public void gainItem(int itemId, short quantity, long period) {
/* 1100 */     gainItem(itemId, quantity, false, period, -1, "", 0);
   }









   public void gainItem(int itemId, short quantity, String owner) {
/* 1112 */     gainItem(itemId, quantity, false, 0L, -1, owner, 0);
   }








   public void gainItem(int itemId, short quantity, String owner, int state) {
/* 1123 */     gainItem(itemId, quantity, false, 0L, -1, owner, state);
   }









   public void gainItem(int itemId, short quantity, boolean randomStats, int slots) {
/* 1135 */     gainItem(itemId, quantity, randomStats, 0L, slots, "", 0);
   }









   public void gainItemByState(int itemId, short quantity, int state) {
/* 1147 */     gainItem(itemId, quantity, false, 0L, -1, "", state);
   }









   public void gainItem(int itemId, short quantity, long period, int state) {
/* 1159 */     gainItem(itemId, quantity, false, period, -1, "", state);
   }










   public void gainItem(int itemId, short quantity, boolean randomStats, long period, int slots) {
/* 1172 */     gainItem(itemId, quantity, randomStats, period, slots, "", 0);
   }











   public void gainItem(int itemId, short quantity, boolean randomStats, long period, int slots, String owner) {
/* 1186 */     gainItem(itemId, quantity, randomStats, period, slots, owner, 0);
   }












   public void gainItem(int itemId, short quantity, boolean randomStats, long period, int slots, String owner, int state) {
/* 1201 */     gainItem(itemId, quantity, randomStats, period, slots, owner, state, getClient());
   }













   public void gainItem(int itemId, short quantity, boolean randomStats, long period, int slots, String owner, int state, MapleClient cg) {
/* 1217 */     if (ItemConstants.isLogItem(itemId)) {
/* 1218 */       String itemText = "玩家 " + StringUtil.getRightPaddedStr(cg.getPlayer().getName(), ' ', 13) + ((quantity >= 0) ? " 获得道具: " : " 失去道具: ") + itemId + " 数量: " + StringUtil.getRightPaddedStr(String.valueOf(Math.abs(quantity)), ' ', 5) + " 道具名字: " + getItemName(itemId);
/* 1219 */       log.info("[物品] " + itemText);
/* 1220 */       WorldBroadcastService.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, "[GM消息] " + itemText));
     }
/* 1222 */     if (quantity >= 0) {
/* 1223 */       MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 1224 */       MapleInventoryType type = ItemConstants.getInventoryType(itemId);
/* 1225 */       if (!MapleInventoryManipulator.checkSpace(cg, itemId, quantity, "")) {
         return;
       }
/* 1228 */       if (type.equals(MapleInventoryType.EQUIP) && !ItemConstants.is飞镖道具(itemId) && !ItemConstants.is子弹道具(itemId)) {
/* 1229 */         Equip item = randomStats ? ii.randomizeStats((Equip)ii.getEquipById(itemId)) : (Equip)ii.getEquipById(itemId);
/* 1230 */         if (period > 0L) {
/* 1231 */           if (period < 1000L) {
/* 1232 */             item.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
           } else {
/* 1234 */             item.setExpiration(System.currentTimeMillis() + period);
           }
         }
/* 1237 */         if (slots > 0) {
/* 1238 */           item.setUpgradeSlots((byte)(item.getUpgradeSlots() + slots));
         }
/* 1240 */         if (state > 0) {
/* 1241 */           int newstate = 16 + state;
/* 1242 */           if (newstate > 20 || newstate < 17) {
/* 1243 */             newstate = 17;
           }
/* 1245 */           item.setPotential1(-newstate);
         }
/* 1247 */         if (owner != null) {
/* 1248 */           item.setOwner(owner);
         }
/* 1250 */         item.setGMLog("脚本获得 " + this.id + " (" + this.id2 + ") 地图: " + cg.getPlayer().getMapId() + " 时间: " + DateUtil.getNowTime());
/* 1251 */         String name = ii.getName(itemId);
/* 1252 */         if (itemId / 10000 == 114 && name != null && name.length() > 0) {
/* 1253 */           String msg = "恭喜您获得勋章 <" + name + ">";
/* 1254 */           cg.getPlayer().dropMessage(-1, msg);
/* 1255 */           cg.getPlayer().dropMessage(5, msg);
         }
/* 1257 */         MapleInventoryManipulator.addbyItem(cg, item.copy());
       } else {
/* 1259 */         MapleInventoryManipulator.addById(cg, itemId, quantity, (owner == null) ? "" : owner, null, period, "脚本获得 " + this.id + " (" + this.id2 + ") 地图: " + cg.getPlayer().getMapId() + " 时间: " + DateUtil.getNowTime());
       }
     } else {
/* 1262 */       MapleInventoryManipulator.removeById(cg, ItemConstants.getInventoryType(itemId), itemId, -quantity, true, false);
     }
/* 1264 */     cg.announce(MaplePacketCreator.getShowItemGain(itemId, quantity, true));
   }






   public boolean removeItem(int itemId) {
/* 1273 */     if (MapleInventoryManipulator.removeById_Lock(getClient(), ItemConstants.getInventoryType(itemId), itemId)) {
/* 1274 */       getClient().announce(MaplePacketCreator.getShowItemGain(itemId, (short)-1, true));
/* 1275 */       return true;
     }
/* 1277 */     return false;
   }







   public boolean removeItem(int itemId, short quantity) {
/* 1287 */     if (MapleInventoryManipulator.removeById(getClient(), ItemConstants.getInventoryType(itemId), itemId, quantity, false, false)) {
/* 1288 */       getClient().announce(MaplePacketCreator.getShowItemGain(itemId, (short)-quantity, true));
/* 1289 */       return true;
     }
/* 1291 */     return false;
   }






   public void removeAllItem(int type) {
/* 1300 */     MapleInventoryManipulator.removeAll(getClient(), getInvType(type));
   }







   public void gainItemAndEquip(int itemId, short slot) {
/* 1310 */     MapleInventoryManipulator.addItemAndEquip(getClient(), itemId, slot);
   }









   public void gainLockItem(int itemId, short quantity, boolean lock, long period) {
/* 1322 */     gainLockItem(itemId, quantity, lock, period, "");
   }










   public void gainLockItem(int itemId, short quantity, boolean lock, long period, String from) {
/* 1335 */     gainLockItem(itemId, quantity, lock, period, from, true);
   }










   public void gainLockItem(int itemId, short quantity, boolean lock, long period, String from, boolean broad) {
     Item item;
/* 1349 */     if (quantity <= 0) {
/* 1350 */       if (getClient().getPlayer().isAdmin()) {
/* 1351 */         getClient().getPlayer().dropMessage(5, "输入的数量错误，数量必须大于0.如果是装备道具不管设置多少都只给1个.");
       }
       return;
     }
/* 1355 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 1356 */     if (!ii.itemExists(itemId)) {
/* 1357 */       if (getClient().getPlayer().isAdmin()) {
/* 1358 */         getClient().getPlayer().dropMessage(5, itemId + " 这个道具不存在.");
       }
       return;
     }
/* 1362 */     if (!MapleInventoryManipulator.checkSpace(getClient(), itemId, quantity, "")) {
/* 1363 */       if (getClient().getPlayer().isAdmin()) {
/* 1364 */         getClient().getPlayer().dropMessage(5, "背包空间不足.");
       }

       return;
     }
/* 1369 */     if (ItemConstants.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
/* 1370 */       item = ii.getEquipById(itemId);
     } else {
/* 1372 */       item = new Item(itemId, (short)0, quantity, (short)0);
     }
/* 1374 */     if (lock) {
/* 1375 */       item.addFlag((short)ItemFlag.封印.getValue());
     }
/* 1377 */     if (period > 0L) {
/* 1378 */       if (period < 1000L) {
/* 1379 */         item.setExpiration(System.currentTimeMillis() + period * 24L * 60L * 60L * 1000L);
       } else {
/* 1381 */         item.setExpiration(System.currentTimeMillis() + period);
       }
     }
/* 1384 */     if (!from.equals("")) {
/* 1385 */       item.setGMLog("从" + from + "中获得 时间: " + DateUtil.getNowTime());
     }
/* 1387 */     MapleInventoryManipulator.addbyItem(getClient(), item);
/* 1388 */     getClient().announce(MaplePacketCreator.getShowItemGain(itemId, quantity, true));
/* 1389 */     if (!from.equals("") && broad) {
/* 1390 */       if (ItemConstants.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
/* 1391 */         WorldBroadcastService.getInstance().broadcastSmega(MaplePacketCreator.itemMegaphone(getClient().getPlayer().getName() + " : 从" + from + "中获得" + ii.getName(itemId) + "！大家一起恭喜他（她）吧！！！！", false, getClient().getChannel(), item));
       } else {
/* 1393 */         WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.getGachaponMega(getClient().getPlayer().getName(), " : 从" + from + "中获得{" + ii.getName(item.getItemId()) + "}！大家一起恭喜他（她）吧！！！！", item, 3, getClient().getChannel()));
       }
     }
   }







   public int getInventoryType(int itemId) {
/* 1405 */     return ItemConstants.getInventoryType(itemId).getType();
   }







   public void worldMessageItem(String message, Item item) {
/* 1415 */     WorldBroadcastService.getInstance().broadcastSmega(MaplePacketCreator.itemMegaphone(message, false, getClient().getChannel(), item));
   }

   public final void worldMessageYellow(String message) {
/* 1419 */     WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.serverNotice(9, getClient().getChannel(), message, true));
   }








   public final void worldMessageEffect(String message, int type, int time) {
/* 1430 */     WorldBroadcastService.getInstance().broadcastMessage(UIPacket.getMapEffectMsg(message, type, time * 1000));
   }







   public final void worldBrodcastEffect(int itemid, String message) {
/* 1440 */     if (itemid > 0) {
/* 1441 */       WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.startMapEffect(message, itemid, true));
     } else {
/* 1443 */       WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.environmentChange(message, BossEffectOpcode.Screen.getValue(), 0));
     }

/* 1446 */     Timer.WorldTimer.getInstance().schedule(() -> WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.removeMapEffect()), 20000L);
   }






   public void changeMusic(String songName) {
/* 1455 */     getMap().broadcastMessage(MaplePacketCreator.musicChange(songName));
   }







   public void channelMessage(int type, String message) {
/* 1465 */     getClient().getChannelServer().broadcastPacket(MaplePacketCreator.serverNotice(type, getClient().getChannel(), message));
   }






   public void worldMessage(String message) {
/* 1474 */     worldMessage(6, message);
   }








   public void worldMessage(int type, String message) {
/* 1485 */     WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.serverNotice(type, message));
   }

   public void worldSpouseMessage(int type, String message) {
/* 1489 */     if (type == 0 || type == 1 || (type >= 6 && type <= 42)) {
/* 1490 */       WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.spouseMessage(type, message));
     } else {
/* 1492 */       WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.serverNotice(6, message));
     }
   }






   public void playerMessage(String message) {
/* 1502 */     playerMessage(5, message);
   }






   public void mapMessage(String message) {
/* 1511 */     mapMessage(5, message);
   }






   public void guildMessage(String message) {
/* 1520 */     guildMessage(5, message);
   }







   public void playerMessage(int type, String message) {
/* 1530 */     getClient().getPlayer().dropMessage(type, message);
   }







   public void dropMessage(int type, String message) {
/* 1540 */     getClient().getPlayer().dropMessage(type, message);
   }







   public void mapMessage(int type, String message) {
/* 1550 */     getClient().getPlayer().getMap().broadcastMessage(MaplePacketCreator.serverNotice(type, message));
   }







   public void guildMessage(int type, String message) {
/* 1560 */     if (getPlayer().getGuildId() > 0) {
/* 1561 */       WorldGuildService.getInstance().guildPacket(getPlayer().getGuildId(), MaplePacketCreator.serverNotice(type, message));
     }
   }






   public void topMessage(String message) {
/* 1571 */     getClient().announce(UIPacket.getTopMsg(message));
   }

   public void topMsg(String string) {
/* 1575 */     topMessage(string);
   }






   public MapleGuild getGuild() {
/* 1584 */     return getGuild(getPlayer().getGuildId());
   }







   public MapleGuild getGuild(int guildid) {
/* 1594 */     return WorldGuildService.getInstance().getGuild(guildid);
   }






   public List<Pair<Integer, MapleGuild>> getGuildList() {
/* 1603 */     return WorldGuildService.getInstance().getGuildList();
   }






   public MapleParty getParty() {
/* 1612 */     return getClient().getPlayer().getParty();
   }






   public int getPartySize() {
/* 1621 */     return (getParty() != null) ? getParty().getMembers().size() : -1;
   }






   public int getPartyID() {
/* 1630 */     return (getParty() != null) ? getParty().getPartyId() : -1;
   }







   public boolean isChrInParty(int cid) {
/* 1640 */     return (getParty() != null && getParty().getMemberById(cid) != null);
   }







   public int getCurrentPartyId(int mapId) {
/* 1650 */     return getMap(mapId).getCurrentPartyId();
   }






   public int getPartyAverageLevel() {
/* 1659 */     return getParty().getAverageLevel();
   }






   public boolean isLeader() {
/* 1668 */     return (getPlayer().getParty() != null && getParty().getLeader().getId() == getClient().getPlayer().getId());
   }







   public void partyMessage(int partyId, String string) {
/* 1678 */     WorldPartyService.getInstance().partyMessage(partyId, string);
   }







   public boolean isAllPartyMembersAllowedJob(int jobId) {
/* 1688 */     if (getParty() == null) {
/* 1689 */       return false;
     }
/* 1691 */     for (MaplePartyCharacter mem : getClient().getPlayer().getParty().getMembers()) {
/* 1692 */       if (mem.getJobId() / 100 != jobId) {
/* 1693 */         return false;
       }
     }
/* 1696 */     return true;
   }








   public final boolean isAllPartyMembersAllowedLevel(int min, int max) {
/* 1707 */     if (getParty() == null) {
/* 1708 */       return false;
     }
/* 1710 */     for (MaplePartyCharacter d2 : getParty().getMembers()) {
/* 1711 */       if (d2.getLevel() >= min && d2.getLevel() <= max)
/* 1712 */         continue;  return false;
     }
/* 1714 */     return true;
   }

   public final boolean isAllPartyMembersNotCoolDown(int questID, int coolDownTime) {
/* 1718 */     return (getParty() != null && getIsInCoolDownMember(questID, coolDownTime) == null);
   }

   public final String getIsInCoolDownMemberName(int questID, int coolDownTime) {
/* 1722 */     MaplePartyCharacter d2 = getIsInCoolDownMember(questID, coolDownTime);
/* 1723 */     return (d2 != null) ? d2.getName() : null;
   }

   public final MaplePartyCharacter getIsInCoolDownMember(int questID, int coolDownTime) {
/* 1727 */     if (getParty() != null) {
/* 1728 */       for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 1729 */         MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 1730 */         if (player == null) {
/* 1731 */           return partyCharacter;
         }
/* 1733 */         MapleQuestStatus status = player.getQuestNAdd(MapleQuest.getInstance(questID));
/* 1734 */         if (status == null || status.getCustomData() == null || Long.valueOf(status.getCustomData()).longValue() + coolDownTime <= System.currentTimeMillis())
           continue;
/* 1736 */         return partyCharacter;
       }
     }
/* 1739 */     return null;
   }

   public String getCustomData(int questid) {
/* 1743 */     return getPlayer().getQuestNAdd(MapleQuest.getInstance(questid)).getCustomData();
   }

   public void setCustomData(int questid, String customdata) {
/* 1747 */     getPlayer().getQuestNAdd(MapleQuest.getInstance(questid)).setCustomData(customdata);
   }

   public final boolean isAllPartyMembersHaveItem(int itemId, int quantity) {
/* 1751 */     if (getParty() == null) {
/* 1752 */       return false;
     }
/* 1754 */     for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 1755 */       MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 1756 */       if (player != null && player.getItemQuantity(itemId) >= quantity)
/* 1757 */         continue;  return false;
     }
/* 1759 */     return true;
   }

   public final String getNotHaveItemMemberName(int itemId, int quantity) {
/* 1763 */     MaplePartyCharacter partyCharacter = getNotHaveItemMember(itemId, quantity);
/* 1764 */     return (partyCharacter != null) ? partyCharacter.getName() : null;
   }

   public final MaplePartyCharacter getNotHaveItemMember(int itemId, int quantity) {
/* 1768 */     if (getParty() != null) {
/* 1769 */       for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 1770 */         MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 1771 */         if (player != null && player.getItemQuantity(itemId) >= quantity)
/* 1772 */           continue;  return partyCharacter;
       }
     }
/* 1775 */     return null;
   }

   public final boolean isAllPartyMembersAllowedPQ(String pqName, int times) {
/* 1779 */     return isAllPartyMembersAllowedPQ(pqName, times, 1);
   }


   public final boolean isAllPartyMembersAllowedPQ(String pqName, int times, int day) {
/* 1784 */     if (getParty() != null) {
/* 1785 */       for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 1786 */         MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 1787 */         if (player == null || player.getDaysPQLog(pqName, day) >= times) {
/* 1788 */           return false;
         }
       }
     }
/* 1792 */     return true;
   }

   public final MaplePartyCharacter getNotAllowedPQMember(String pqName, int times, int day) {
/* 1796 */     if (getParty() == null) {
/* 1797 */       return null;
     }
/* 1799 */     for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 1800 */       MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 1801 */       if (player == null || player.getDaysPQLog(pqName, day) >= times) {
/* 1802 */         return partyCharacter;
       }
     }
/* 1805 */     return null;
   }

   public final String getNotAllowedPQMemberName(String pqName, int times) {
/* 1809 */     return getNotAllowedPQMemberName(pqName, times, 1);
   }

   public final String getNotAllowedPQMemberName(String string, int times, int day) {
/* 1813 */     if (getNotAllowedPQMember(string, times, day) != null) {
/* 1814 */       return getNotAllowedPQMember(string, times, day).getName();
     }
/* 1816 */     return null;
   }

   public final void gainMembersPQ(String pqName, int num) {
/* 1820 */     if (getParty() == null) {
       return;
     }
/* 1823 */     for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 1824 */       MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 1825 */       if (player == null)
/* 1826 */         continue;  player.setPQLog(pqName, 0, num);
     }
   }

   public int getDaysPQLog(String pqName, int days) {
/* 1831 */     return getPlayer().getDaysPQLog(pqName, 0, days);
   }

   public int getPQLog(String pqName) {
/* 1835 */     return getPlayer().getPQLog(pqName);
   }

   public int getPQLog(String pqName, int type) {
/* 1839 */     return getPlayer().getPQLog(pqName, type);
   }

   public int getPQLog(String pqName, int type, int days) {
/* 1843 */     return getPlayer().getDaysPQLog(pqName, type, days);
   }

   public void setPQLog(String pqName) {
/* 1847 */     getPlayer().setPQLog(pqName);
   }

   public void setPQLog(String pqName, int type) {
/* 1851 */     getPlayer().setPQLog(pqName, type);
   }

   public void setPQLog(String pqName, int type, int count) {
/* 1855 */     getPlayer().setPQLog(pqName, type, count);
   }

   public void resetPQLog(String pqName) {
/* 1859 */     getPlayer().resetPQLog(pqName);
   }

   public void resetPQLog(String pqName, int type) {
/* 1863 */     getPlayer().resetPQLog(pqName, type);
   }

   public void setPartyPQLog(String pqName) {
/* 1867 */     setPartyPQLog(pqName, 0);
   }

   public void setPartyPQLog(String pqName, int type) {
/* 1871 */     setPartyPQLog(pqName, type, 1);
   }

   public void setPartyPQLog(String pqName, int type, int count) {
/* 1875 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 1876 */       getPlayer().setPQLog(pqName, type, count);
       return;
     }
/* 1879 */     int n4 = getPlayer().getMapId();
/* 1880 */     for (MaplePartyCharacter partyCharacter : getPlayer().getParty().getMembers()) {
/* 1881 */       MapleCharacter player = getPlayer().getMap().getCharacterById(partyCharacter.getId());
/* 1882 */       if (player == null || player.getMapId() != n4)
/* 1883 */         continue;  player.setPQLog(pqName, type, count);
     }
   }






   public boolean allMembersHere() {
/* 1893 */     if (getClient().getPlayer().getParty() == null) {
/* 1894 */       return false;
     }
/* 1896 */     for (MaplePartyCharacter mem : getClient().getPlayer().getParty().getMembers()) {
/* 1897 */       MapleCharacter chr = getClient().getPlayer().getMap().getCharacterById(mem.getId());
/* 1898 */       if (chr == null) {
/* 1899 */         return false;
       }
     }
/* 1902 */     return true;
   }






   public boolean allMembersChannel() {
/* 1911 */     if (getClient().getPlayer().getParty() == null) {
/* 1912 */       return false;
     }
/* 1914 */     for (MaplePartyCharacter mem : getClient().getPlayer().getParty().getMembers()) {
/* 1915 */       if (mem.getChannel() != getMap().getChannel()) {
/* 1916 */         return false;
       }
     }
/* 1919 */     return true;
   }






   public void warpParty(int mapId) {
/* 1928 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 1929 */       warp(mapId, 0);
       return;
     }
/* 1932 */     MapleMap target = getMap(mapId);
/* 1933 */     int cMap = getPlayer().getMapId();
/* 1934 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 1935 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 1936 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 1937 */         curChar.changeMap(target, target.getPortal(0));
       }
     }
   }







   public void warpParty(int mapId, int portal) {
/* 1949 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 1950 */       if (portal < 0) {
/* 1951 */         warp(mapId);
       } else {
/* 1953 */         warp(mapId, portal);
       }
       return;
     }
/* 1957 */     boolean rand = (portal < 0);
/* 1958 */     MapleMap target = getMap(mapId);
/* 1959 */     int cMap = getPlayer().getMapId();
/* 1960 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 1961 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 1962 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 1963 */         if (rand) {
           try {
/* 1965 */             curChar.changeMap(target, target.getPortal(nextInt(target.getPortals().size())));
/* 1966 */           } catch (Exception e) {
/* 1967 */             curChar.changeMap(target, target.getPortal(0));
           }  continue;
         }
/* 1970 */         curChar.changeMap(target, target.getPortal(portal));
       }
     }
   }





   public void warpParty_Instanced(int mapId) {
/* 1980 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 1981 */       warp_Instanced(mapId);
       return;
     }
/* 1984 */     MapleMap target = getMap_Instanced(mapId);

/* 1986 */     int cMap = getPlayer().getMapId();
/* 1987 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 1988 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 1989 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 1990 */         curChar.changeMap(target, target.getPortal(0));
       }
     }
   }






   public void gainMeso(long gain) {
/* 2001 */     getClient().getPlayer().gainMeso(gain, true, true);
   }






   public void gainExp(long gain) {
/* 2010 */     getClient().getPlayer().gainExp(gain, true, true, true);
   }






   public void gainExpR(long gain) {
/* 2019 */     getClient().getPlayer().gainExp(gain * getClient().getChannelServer().getExpRate(), true, true, true);
   }








   public void addPartyTrait(String t, int e) {
/* 2030 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 2031 */       addTrait(t, e);
       return;
     }
/* 2034 */     int cMap = getPlayer().getMapId();
/* 2035 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 2036 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 2037 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 2038 */         curChar.getTrait(MapleTraitType.valueOf(t)).addExp(e, curChar);
       }
     }
   }




   public void addTrait(String t, int e) {
/* 2047 */     getPlayer().getTrait(MapleTraitType.valueOf(t)).addExp(e, getPlayer());
   }







   public void givePartyItems(int itemId, short quantity) {
/* 2057 */     givePartyItems(itemId, quantity, false);
   }




   public void givePartyItems(int itemId, short quantity, boolean removeAll) {
/* 2064 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 2065 */       gainItem(itemId, (short)(removeAll ? -getPlayer().itemQuantity(itemId) : quantity));
       return;
     }
/* 2068 */     int cMap = getPlayer().getMapId();
/* 2069 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 2070 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 2071 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 2072 */         gainItem(itemId, (short)(removeAll ? -curChar.itemQuantity(itemId) : quantity), false, 0L, 0, "", 0, curChar.getClient());
       }
     }
   }

   public void givePartyExp_PQ(int maxLevel, double mod, List<MapleCharacter> party) {
/* 2078 */     for (MapleCharacter chr : party) {
/* 2079 */       int amount = (int)Math.round(GameConstants.getExpNeededForLevel((chr.getLevel() > maxLevel) ? (maxLevel + (maxLevel - chr.getLevel()) / 10) : chr.getLevel()) / Math.min(chr.getLevel(), maxLevel) / 5.0D / mod * 2.0D);
/* 2080 */       chr.gainExp((amount * getClient().getChannelServer().getExpRate()), true, true, true);
     }
   }

   public void gainExp_PQ(int maxLevel, double mod) {
/* 2085 */     int amount = (int)Math.round(GameConstants.getExpNeededForLevel((getPlayer().getLevel() > maxLevel) ? (maxLevel + getPlayer().getLevel() / 10) : getPlayer().getLevel()) / Math.min(getPlayer().getLevel(), maxLevel) / 10.0D / mod);
/* 2086 */     gainExp((amount * getClient().getChannelServer().getExpRate()));
   }

   public void givePartyExp_PQ(int maxLevel, double mod) {
/* 2090 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 2091 */       int amount = (int)Math.round(GameConstants.getExpNeededForLevel((getPlayer().getLevel() > maxLevel) ? (maxLevel + getPlayer().getLevel() / 10) : getPlayer().getLevel()) / Math.min(getPlayer().getLevel(), maxLevel) / 10.0D / mod);
/* 2092 */       gainExp((amount * getClient().getChannelServer().getExpRate()));
       return;
     }
/* 2095 */     int cMap = getPlayer().getMapId();
/* 2096 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 2097 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 2098 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 2099 */         int amount = (int)Math.round(GameConstants.getExpNeededForLevel((curChar.getLevel() > maxLevel) ? (maxLevel + curChar.getLevel() / 10) : curChar.getLevel()) / Math.min(curChar.getLevel(), maxLevel) / 10.0D / mod);
/* 2100 */         curChar.gainExp((amount * getClient().getChannelServer().getExpRate()), true, true, true);
       }
     }
   }

   public void givePartyExp(int amount, List<MapleCharacter> party) {
/* 2106 */     for (MapleCharacter chr : party) {
/* 2107 */       chr.gainExp((amount * getClient().getChannelServer().getExpRate()), true, true, true);
     }
   }

   public void givePartyExp(int amount) {
/* 2112 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 2113 */       gainExp((amount * getClient().getChannelServer().getExpRate()));
       return;
     }
/* 2116 */     int cMap = getPlayer().getMapId();
/* 2117 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 2118 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 2119 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 2120 */         curChar.gainExp((amount * getClient().getChannelServer().getExpRate()), true, true, true);
       }
     }
   }

   public void givePartyNX(int amount, List<MapleCharacter> party) {
/* 2126 */     for (MapleCharacter chr : party) {
/* 2127 */       chr.modifyCSPoints(1, amount, true);
     }
   }

   public void givePartyNX(int amount) {
/* 2132 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 2133 */       gainNX(amount);
       return;
     }
/* 2136 */     int cMap = getPlayer().getMapId();
/* 2137 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 2138 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 2139 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 2140 */         curChar.modifyCSPoints(1, amount, true);
       }
     }
   }

   public void endPartyQuest(int amount, List<MapleCharacter> party) {
/* 2146 */     for (MapleCharacter chr : party) {
/* 2147 */       chr.endPartyQuest(amount);
     }
   }

   public void endPartyQuest(int amount) {
/* 2152 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 2153 */       getPlayer().endPartyQuest(amount);
       return;
     }
/* 2156 */     int cMap = getPlayer().getMapId();
/* 2157 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 2158 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 2159 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 2160 */         curChar.endPartyQuest(amount);
       }
     }
   }

   public void removeFromParty(int itemId, List<MapleCharacter> party) {
/* 2166 */     for (MapleCharacter chr : party) {
/* 2167 */       int possesed = chr.getInventory(ItemConstants.getInventoryType(itemId)).countById(itemId);
/* 2168 */       if (possesed > 0) {
/* 2169 */         MapleInventoryManipulator.removeById(getClient(), ItemConstants.getInventoryType(itemId), itemId, possesed, true, false);
/* 2170 */         chr.send(MaplePacketCreator.getShowItemGain(itemId, (short)-possesed, true));
       }
     }
   }

   public void removeFromParty(int itemId) {
/* 2176 */     givePartyItems(itemId, (short)0, true);
   }








   public void giveCharListItems(int itemId, short quantity, List<MapleCharacter> characters) {
/* 2187 */     for (MapleCharacter chr : characters) {
/* 2188 */       if (quantity >= 0) {
/* 2189 */         MapleInventoryManipulator.addById(chr.getClient(), itemId, quantity, "Received from party interaction " + itemId + " (" + this.id + ")");
       } else {
/* 2191 */         MapleInventoryManipulator.removeById(chr.getClient(), ItemConstants.getInventoryType(itemId), itemId, -quantity, true, false);
       }
/* 2193 */       chr.send(MaplePacketCreator.getShowItemGain(itemId, quantity, true));
     }
   }








   public void addCharListTrait(String t, int e, List<MapleCharacter> characters) {
/* 2205 */     for (MapleCharacter chr : characters) {
/* 2206 */       chr.getTrait(MapleTraitType.valueOf(t)).addExp(e, chr);
     }
   }







   public void useSkill(int skillId, int skillLevel) {
/* 2217 */     if (skillLevel <= 0) {
       return;
     }
/* 2220 */     Skill skill = SkillFactory.getSkill(skillId);
/* 2221 */     if (skill != null) {
/* 2222 */       skill.getEffect(skillLevel).applyTo(getClient().getPlayer());
     }
   }






   public void useItem(int itemId) {
/* 2232 */     MapleItemInformationProvider.getInstance().getItemEffect(itemId).applyTo(getClient().getPlayer());
/* 2233 */     getClient().announce(UIPacket.getStatusMsg(itemId));
   }






   public void cancelItem(int itemId) {
/* 2242 */     getClient().getPlayer().cancelEffect(MapleItemInformationProvider.getInstance().getItemEffect(itemId), false, -1L);
   }






   public int getMorphState() {
/* 2251 */     return getClient().getPlayer().getMorphState();
   }






   public void removeAll(int itemId) {
/* 2260 */     getClient().getPlayer().removeAll(itemId);
   }

   public void gainCloseness(int closeness, int index) {
/* 2264 */     MaplePet pet = getPlayer().getSpawnPet(index);
/* 2265 */     if (pet != null) {
/* 2266 */       pet.setCloseness(pet.getCloseness() + closeness * ServerConfig.CHANNEL_RATE_TRAIT);
/* 2267 */       getPlayer().petUpdateStats(pet, true);
     }
   }

   public void gainClosenessAll(int closeness) {
/* 2272 */     MaplePet[] pets = getPlayer().getSpawnPets();
/* 2273 */     for (int i = 0; i < 3; i++) {
/* 2274 */       if (pets[i] != null && pets[i].getSummoned()) {
/* 2275 */         pets[i].setCloseness(pets[i].getCloseness() + closeness);
/* 2276 */         getPlayer().petUpdateStats(pets[i], true);
       }
     }
   }






   public void resetMap(int mapId) {
/* 2287 */     getMap(mapId).resetFully();
   }






   public void openNpc(int npcId) {
/* 2296 */     getClient().removeClickedNPC();
/* 2297 */     NPCScriptManager.getInstance().start(getClient(), npcId);
   }







   public void openNpc(MapleClient client, int npcId) {
/* 2307 */     client.removeClickedNPC();
/* 2308 */     NPCScriptManager.getInstance().start(client, npcId);
   }







   public void openNpc(int npcId, String npcMode) {
/* 2318 */     getClient().removeClickedNPC();
/* 2319 */     NPCScriptManager.getInstance().start(getClient(), npcId, npcMode);
   }






   public int getMapId() {
/* 2328 */     return getClient().getPlayer().getMap().getId();
   }




   public boolean haveMonster(int mobId) {
/* 2335 */     for (MapleMapObject obj : getClient().getPlayer().getMap().getAllMonstersThreadsafe()) {
/* 2336 */       MapleMonster mob = (MapleMonster)obj;
/* 2337 */       if (mob.getId() == mobId) {
/* 2338 */         return true;
       }
     }
/* 2341 */     return false;
   }






   public int getChannelNumber() {
/* 2350 */     return getClient().getChannel();
   }

   public boolean getMonsterByID(int mobid) {
/* 2354 */     return (getMap().getMonsterById(mobid) != null);
   }







   public int getMonsterCount(int mapId) {
/* 2364 */     return getMonsterCount(mapId, -1);
   }








   public int getMonsterCount(int mapId, int mobid) {
/* 2375 */     return getClient().getChannelServer().getMapFactory().getMap(mapId).getNumMonsters(mobid);
   }








   public void teachSkill(int skillId, int skilllevel, byte masterlevel) {
/* 2386 */     getPlayer().changeSingleSkillLevel(SkillFactory.getSkill(skillId), skilllevel, masterlevel);
   }







   public void teachSkill(int skillId, int skilllevel) {
/* 2396 */     Skill skil = SkillFactory.getSkill(skillId);
/* 2397 */     if (skil == null) {
       return;
     }
/* 2400 */     if (getPlayer().getSkillLevel(skil) > skilllevel) {
/* 2401 */       skilllevel = getPlayer().getSkillLevel(skil);
     }
/* 2403 */     getPlayer().changeSingleSkillLevel(skil, skilllevel, (byte)skil.getMaxLevel());
   }







   public int getSkillLevel(int skillId) {
/* 2413 */     return getPlayer().getSkillLevel(skillId);
   }







   public int getPlayerCount(int mapId) {
/* 2423 */     return getClient().getChannelServer().getMapFactory().getMap(mapId).getCharactersSize();
   }

   public void dojo_getUp() {
/* 2427 */     getClient().announce(MaplePacketCreator.updateInfoQuest(1207, "pt=1;min=4;belt=1;tuto=1"));
/* 2428 */     getClient().announce(EffectPacket.Mulung_DojoUp2());
/* 2429 */     instantMapWarp((byte)6);
   }

   public void instantMapWarp(byte by2) {
/* 2433 */     getClient().announce(MaplePacketCreator.instantMapWarp(by2));
   }

   public void curentMapWarp(int type, Point pos) {
/* 2437 */     getClient().announce(MaplePacketCreator.instantMapWarp(type, pos));
   }

   public boolean dojoAgent_NextMap(boolean dojo, boolean fromresting) {
/* 2441 */     if (dojo) {
/* 2442 */       return MapleDojoAgent.warpNextMap(getPlayer(), fromresting, getPlayer().getMap());
     }
/* 2444 */     return MapleDojoAgent.warpNextMap_Agent(getPlayer(), fromresting);
   }

   public boolean dojoAgent_NextMap(boolean dojo, boolean fromresting, int mapid) {
/* 2448 */     if (dojo) {
/* 2449 */       return MapleDojoAgent.warpNextMap(getPlayer(), fromresting, getMap(mapid));
     }
/* 2451 */     return MapleDojoAgent.warpNextMap_Agent(getPlayer(), fromresting);
   }


   public int dojo_getPts() {
/* 2456 */     return getClient().getPlayer().getIntNoRecord(150100);
   }







   public MapleEvent getEvent(String string) {
/* 2466 */     return getChannelServer().getEvent(MapleEventType.getByString(string));
   }







   public boolean isEventStart(String string) {
/* 2476 */     return (getChannelServer().getEvent() == getChannelServer().getEvent(MapleEventType.getByString(string)).getMap(0).getId());
   }

   public int getSavedLocation(String loc) {
/* 2480 */     Integer ret = Integer.valueOf(getClient().getPlayer().getSavedLocation(SavedLocationType.fromString(loc)));
/* 2481 */     if (ret.intValue() == -1) {
/* 2482 */       return 100000000;
     }
/* 2484 */     return ret.intValue();
   }

   public void saveLocation(String loc) {
/* 2488 */     getClient().getPlayer().saveLocation(SavedLocationType.fromString(loc));
   }

   public void saveReturnLocation(String loc) {
/* 2492 */     getClient().getPlayer().saveLocation(SavedLocationType.fromString(loc), getClient().getPlayer().getMap().getReturnMap().getId());
   }

   public void clearSavedLocation(String loc) {
/* 2496 */     getClient().getPlayer().clearSavedLocation(SavedLocationType.fromString(loc));
   }

   public void summonMsg(String msg) {
/* 2500 */     if (!getClient().getPlayer().hasSummon()) {
/* 2501 */       playerSummonHint(true);
     }
/* 2503 */     getClient().announce(UIPacket.summonMessage(msg));
   }

   public void summonMsg(int type) {
/* 2507 */     if (!getClient().getPlayer().hasSummon()) {
/* 2508 */       playerSummonHint(true);
     }
/* 2510 */     getClient().announce(UIPacket.summonMessage(type));
   }

   public void showInstruction(String msg, int width, int height) {
/* 2514 */     getClient().announce(MaplePacketCreator.sendHint(msg, width, height));
   }

   public void playerSummonHint(boolean summon) {
/* 2518 */     getClient().getPlayer().setHasSummon(summon);
/* 2519 */     getClient().announce(UIPacket.summonHelper(summon));
   }

   public String getInfoQuest(int questId) {
/* 2523 */     return getClient().getPlayer().getInfoQuest(questId);
   }

   public void updateInfoQuest(int questId, String data) {
/* 2527 */     getClient().getPlayer().updateInfoQuest(questId, data);
   }

   public boolean getEvanIntroState(String data) {
/* 2531 */     return getInfoQuest(22013).equals(data);
   }

   public void updateEvanIntroState(String data) {
/* 2535 */     updateInfoQuest(22013, data);
   }

   public void Aran_Start() {
/* 2539 */     getClient().announce(UIPacket.Aran_Start());
   }

   public void evanTutorial(String data, int v1) {
/* 2543 */     getClient().announce(NPCPacket.getEvanTutorial(data));
   }

   public void AranTutInstructionalBubble(String data) {
/* 2547 */     getClient().announce(EffectPacket.AranTutInstructionalBalloon(data));
   }

   public void TutInstructionalBalloon(String data) {
/* 2551 */     AranTutInstructionalBubble(data);
   }

   public void showWZEffect(String data) {
/* 2555 */     getClient().announce(EffectPacket.ShowWZEffect(data));
   }

   public void showEffect(String effect) {
/* 2559 */     getClient().announce(MaplePacketCreator.showEffect(effect));
   }

   public void playSound(String sound) {
/* 2563 */     playSound(false, sound);
   }

   public void playSound(boolean broadcast, String sound) {
/* 2567 */     if (broadcast) {
/* 2568 */       getMap().broadcastMessage(MaplePacketCreator.playSound(sound));
     } else {
/* 2570 */       getClient().announce(MaplePacketCreator.playSound(sound));
     }
   }

   public void startMapEffect(String msg, int itemId) {
/* 2575 */     getClient().getPlayer().getMap().startMapEffect(msg, itemId);
   }

   public void showMapEffect(String path) {
/* 2579 */     getClient().announce(UIPacket.showMapEffect(path));
   }

   public void EnableUI(short i) {
/* 2583 */     getClient().announce(UIPacket.IntroEnableUI(i));
   }







   public void EnableUI(short lock, boolean block) {
/* 2593 */     getClient().announce(UIPacket.IntroEnableUI(lock, block));
   }

   public void DisableUI(boolean enabled) {
/* 2597 */     getClient().announce(UIPacket.IntroDisableUI(enabled));
   }

   public void MovieClipIntroUI(boolean enabled) {
/* 2601 */     getClient().announce(UIPacket.IntroDisableUI(enabled));
/* 2602 */     getClient().announce(UIPacket.IntroLock(enabled));
   }




   public void lockUI() {
/* 2609 */     getClient().announce(UIPacket.IntroDisableUI(true));
/* 2610 */     getClient().announce(UIPacket.IntroLock(true));
   }




   public void unlockUI() {
/* 2617 */     getClient().announce(UIPacket.IntroDisableUI(false));
/* 2618 */     getClient().announce(UIPacket.IntroLock(false));
   }

   public MapleInventoryType getInvType(int i) {
/* 2622 */     return MapleInventoryType.getByType((byte)i);
   }







   public String getItemName(int itemId) {
/* 2632 */     return MapleItemInformationProvider.getInstance().getName(itemId);
   }






   public void gainPetItem(int itemid) {
/* 2641 */     gainPetItem(itemid, (short)1);
   }







   public void gainPetItem(int itemid, short quantity) {
/* 2651 */     MapleInventoryManipulator.addById(getClient(), itemid, quantity, "", MaplePet.createPet(itemid, MapleInventoryIdentifier.getInstance()), 45L, getName() + "脚本获得");
   }












   public void gainPet(int itemId, String name, int level, int closeness, int fullness, long period, short flags) {
/* 2666 */     if (itemId / 10000 != 500) {
/* 2667 */       itemId = 5000000;
     }
/* 2669 */     if (level > 30) {
/* 2670 */       level = 30;
     }
/* 2672 */     if (closeness > 30000) {
/* 2673 */       closeness = 30000;
     }
/* 2675 */     if (fullness > 100) {
/* 2676 */       fullness = 100;
     }
     try {
/* 2679 */       MapleInventoryManipulator.addById(getClient(), itemId, (short)1, "", MaplePet.createPet(itemId, name, level, closeness, fullness, MapleInventoryIdentifier.getInstance(), (itemId == 5000054) ? (int)period : 0, flags, 0, -1), 45L, "Pet from interaction " + itemId + " (" + this.id + ") on " + DateUtil.getCurrentDate());
/* 2680 */     } catch (NullPointerException ex) {
/* 2681 */       ex.printStackTrace();
     }
   }







   public short getPetFlagInfo(int petItemId) {
/* 2692 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 2693 */     return ii.getPetFlagInfo(petItemId);
   }

   public void removeSlot(int invType, short slot, short quantity) {
/* 2697 */     MapleInventoryManipulator.removeFromSlot(getClient(), getInvType(invType), slot, quantity, true);
   }

   public void gainGP(int gp) {
/* 2701 */     if (getPlayer().getGuildId() <= 0) {
       return;
     }
/* 2704 */     WorldGuildService.getInstance().gainGP(getPlayer().getGuildId(), gp);
   }

   public int getGP() {
/* 2708 */     if (getPlayer().getGuildId() <= 0) {
/* 2709 */       return 0;
     }
/* 2711 */     return WorldGuildService.getInstance().getGP(getPlayer().getGuildId());
   }

   public int itemQuantity(int itemId) {
/* 2715 */     return getPlayer().itemQuantity(itemId);
   }

   public EventInstanceManager getDisconnected(String event) {
/* 2719 */     EventManager em = getEventManager(event);
/* 2720 */     if (em == null) {
/* 2721 */       return null;
     }
/* 2723 */     for (EventInstanceManager eim : em.getInstances()) {
/* 2724 */       if (eim.isDisconnected(getClient().getPlayer()) && eim.getPlayerCount() > 0) {
/* 2725 */         return eim;
       }
     }
/* 2728 */     return null;
   }

   public EventInstanceManager getEIMbyEvenName(String string) {
/* 2732 */     EventManager em = getEventManager(string);
/* 2733 */     if (em == null) {
/* 2734 */       return null;
     }
/* 2736 */     for (EventInstanceManager eim : em.getInstances()) {
/* 2737 */       if (eim.getPlayerCount() <= 0)
/* 2738 */         continue;  return eim;
     }
/* 2740 */     return null;
   }

   public boolean isAllReactorState(int reactorId, int state) {
/* 2744 */     boolean ret = false;
/* 2745 */     for (MapleReactor r : getMap().getAllReactorsThreadsafe()) {
/* 2746 */       if (r.getReactorId() == reactorId) {
/* 2747 */         ret = (r.getState() == state);
       }
     }
/* 2750 */     return ret;
   }

   public long getCurrentTime() {
/* 2754 */     return System.currentTimeMillis();
   }

   public void spawnMonster(int mobId) {
/* 2758 */     spawnMonster(mobId, 1, getPlayer().getTruePosition());
   }


   public void spawnMonster(int mobId, int x, int y) {
/* 2763 */     spawnMonster(mobId, 1, new Point(x, y));
   }


   public void spawnMonster(int mobId, int quantity, int x, int y) {
/* 2768 */     spawnMonster(mobId, quantity, new Point(x, y));
   }


   public void spawnMonster(int mobId, int quantity, Point pos) {
/* 2773 */     for (int i = 0; i < quantity; i++) {
/* 2774 */       getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), pos);
     }
   }

   public void sendNPCText(String text, int npcId) {
/* 2779 */     getMap().broadcastMessage(NPCPacket.getNPCTalk(npcId, (byte)0, text, "00 00 00 00 00 00", (byte)0));
   }

   public boolean getTempFlag(int flag) {
/* 2783 */     return ((getClient().getChannelServer().getTempFlag() & flag) == flag);
   }





   public void logPQ(String text) {}





   public void trembleEffect(int type, int delay) {
/* 2797 */     getClient().announce(MaplePacketCreator.trembleEffect(type, delay, 1));
   }








   public void trembleEffect(int type, int delay, int tremble) {
/* 2808 */     getClient().announce(MaplePacketCreator.trembleEffect(type, delay, tremble));
   }

   public int nextInt(int arg0) {
/* 2812 */     return Randomizer.nextInt(arg0);
   }

   public MapleQuest getQuest(int arg0) {
/* 2816 */     return MapleQuest.getInstance(arg0);
   }

   public void achievement(int a) {
/* 2820 */     getClient().getPlayer().getMap().broadcastMessage(MaplePacketCreator.achievementRatio(a));
   }

   public MapleInventory getInventory(int type) {
/* 2824 */     return getClient().getPlayer().getInventory(MapleInventoryType.getByType((byte)type));
   }







   public void addSlot(int type, short slot) {
/* 2834 */     getClient().getPlayer().getInventory(MapleInventoryType.getByType((byte)type)).addSlot(slot);
   }

   public int randInt(int arg0) {
/* 2838 */     return Randomizer.nextInt(arg0);
   }

   public void sendDirectionStatus(int key, int value) {
/* 2842 */     sendDirectionStatus(key, value, true);
   }

   public void sendDirectionStatus(int key, int value, boolean direction) {
/* 2846 */     getClient().announce(UIPacket.getDirectionInfo(key, value));
/* 2847 */     getClient().announce(UIPacket.getDirectionStatus(direction));
   }

   public void getDirectionStatus(boolean enable) {
/* 2851 */     getClient().announce(UIPacket.inGameCurNodeEventEnd(enable));
   }

   public void sendDirectionInfo(String data) {
/* 2855 */     getClient().announce(UIPacket.getDirectionInfo(data, 2000, 0, -100, 0));
/* 2856 */     getClient().announce(UIPacket.getDirectionInfo(1, 2000));
   }

   public void getDirectionInfo(byte type, int value) {
/* 2860 */     getClient().announce(UIPacket.getDirectionInfo(type, value));
   }

   public void getDirectionInfo(int value, int x, int y) {
/* 2864 */     getClient().announce(UIPacket.getDirectionInfo(value, x, y));
   }

   public void getDirectionInfo(String data, int value, int x, int y, int a, int b) {
/* 2868 */     getClient().announce(UIPacket.getDirectionInfo(data, value, x, y, a, b));
   }

   public void sendDirectionFacialExpression(int expression, int duration) {
/* 2872 */     getClient().announce(UIPacket.getDirectionFacialExpression(expression, duration));
   }

   public void getDirectionInfoNew(byte type, int value) {
/* 2876 */     getClient().announce(UIPacket.getDirectionInfoNew(type, value));
   }

   public void getDirectionInfoNew(byte type, int x, int y, int z) {
/* 2880 */     getClient().announce(UIPacket.getDirectionInfoNew(type, x, y, z));
   }

   public void getDIRECTION_INFO(int value, int s, String data) {
/* 2884 */     getClient().announce(UIPacket.getDIRECTION_INFO(data, value, s));
   }

   public void getDirectionEffect(String data, int value, int x, int y) {
/* 2888 */     getClient().announce(UIPacket.getDirectionEffect(data, value, x, y));
   }

   public void getDirectionEffect(int mod, String data, int value, int value2, int value3, int a1, int a2, int a3, int a4, int npc) {
/* 2892 */     getClient().announce(UIPacket.getDirectionEffect(mod, data, value, value2, value3, a1, a2, a3, a4, npc));
   }




   public void setSpineScreen(String env, String value) {
/* 2899 */     setSpineScreen(false, Short.valueOf((short)1), env, value, false, "");
   }

   public void setSpineScreen(boolean broadcast, Short a, String env, String value, boolean b, String value2) {
/* 2903 */     if (broadcast) {
/* 2904 */       getPlayer().getMap().broadcastMessage(UIPacket.SpineScreen(a.shortValue(), env, value, Boolean.valueOf(b), value2));
     } else {
/* 2906 */       getClient().announce(UIPacket.SpineScreen(a.shortValue(), env, value, Boolean.valueOf(b), value2));
     }
   }




   public int getProfessions() {
/* 2914 */     int ii = 0;

/* 2916 */     for (int i = 0; i < 5; i++) {
/* 2917 */       int skillId = 92000000 + i * 10000;
/* 2918 */       if (getClient().getPlayer().getProfessionLevel(skillId) > 0) {
/* 2919 */         ii++;
       }
     }
/* 2922 */     return ii;
   }

   public void setVip(int vip, long period) {
/* 2926 */     getClient().getPlayer().setVip(vip);
/* 2927 */     if (period > 0L) {
/* 2928 */       getClient().getPlayer().setViptime(period);
     }
   }

   public int getVip() {
/* 2933 */     return getClient().getPlayer().getVip();
   }

   public boolean isVip() {
/* 2937 */     return (getClient().getPlayer().getVip() > 0);
   }




   public void setVip(int vip) {
/* 2944 */     setVip(vip, 7L);
   }

   public void setViptime(long period) {
/* 2948 */     if (period != 0L) {
/* 2949 */       getClient().getPlayer().setViptime(period);
     }
   }







   public int getBossLog(String bossid) {
/* 2960 */     return getClient().getPlayer().getBossLog(bossid);
   }

   public int getBossLog(String bossid, int type) {
/* 2964 */     return getClient().getPlayer().getBossLog(bossid, type);
   }






   public void setBossLog(String bossid) {
/* 2973 */     getClient().getPlayer().setBossLog(bossid);
   }







   public void setBossLog(String bossid, int type) {
/* 2983 */     getClient().getPlayer().setBossLog(bossid, type);
   }








   public void setBossLog(String bossid, int type, int count) {
/* 2994 */     getClient().getPlayer().setBossLog(bossid, type, count);
   }






   public void resetBossLog(String bossid) {
/* 3003 */     getClient().getPlayer().resetBossLog(bossid);
   }







   public void resetBossLog(String bossid, int type) {
/* 3013 */     getClient().getPlayer().resetBossLog(bossid, type);
   }






   public void setPartyBossLog(String bossid) {
/* 3022 */     setPartyBossLog(bossid, 0);
   }







   public void setPartyBossLog(String bossid, int type) {
/* 3032 */     setPartyBossLog(bossid, type, 1);
   }








   public void setPartyBossLog(String bossid, int type, int count) {
/* 3043 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 3044 */       getClient().getPlayer().setBossLog(bossid, type, count);
       return;
     }
/* 3047 */     int cMap = getPlayer().getMapId();
/* 3048 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 3049 */       MapleCharacter curChar = getPlayer().getMap().getCharacterById(chr.getId());
/* 3050 */       if (curChar != null && curChar.getMapId() == cMap) {
/* 3051 */         curChar.setBossLog(bossid, type, count);
       }
     }
   }







   public int getBossLogAcc(String bossid) {
/* 3063 */     return getClient().getPlayer().getBossLogAcc(bossid);
   }







   public void setBossLogAcc(String bossid) {
/* 3073 */     getClient().getPlayer().setBossLogAcc(bossid);
   }







   public void setBossLogAcc(String bossid, int bosscount) {
/* 3083 */     getClient().getPlayer().setBossLogAcc(bossid, bosscount);
   }

   public int getEventLogForDay(String eventId) {
/* 3087 */     return getClient().getPlayer().getEventLogForDay(eventId);
   }

   public void setEventLogForDay(String eventId) {
/* 3091 */     getClient().getPlayer().setEventLogForDay(eventId);
   }

   public void setEventLogForDay(String eventId, int eventCount) {
/* 3095 */     getClient().getPlayer().setEventLogForDay(eventId, eventCount);
   }

   public void resetEventLogForDay(String eventId) {
/* 3099 */     getClient().getPlayer().resetEventLogForDay(eventId);
   }






   public int getGamePoints() {
/* 3108 */     return getClient().getPlayer().getGamePoints();
   }






   public void gainGamePoints(int amount) {
/* 3117 */     getClient().getPlayer().gainGamePoints(amount);
   }




   public void resetGamePoints() {
/* 3124 */     getClient().getPlayer().resetGamePoints();
   }






   public void getClock(int time) {
/* 3133 */     getClient().announce(MaplePacketCreator.getClock(time));
   }






   public void openWeb(String web) {
/* 3142 */     getClient().announce(MaplePacketCreator.openWeb(web));
   }




   public boolean isCanPvp() {
/* 3149 */     return ServerConfig.CHANNEL_OPENPVP;
   }




   public void showDoJangRank() {
/* 3156 */     getClient().announce(MaplePacketCreator.getMulungRanking((byte)1));
   }




   public int MarrageChecking() {
/* 3163 */     if (getPlayer().getParty() == null)
/* 3164 */       return -1; 
/* 3165 */     if (getPlayer().getMarriageId() > 0)
/* 3166 */       return 0; 
/* 3167 */     if (getPlayer().getParty().getMembers().size() != 2)
/* 3168 */       return 1; 
/* 3169 */     if (getPlayer().getGender() == 0 && !getPlayer().haveItem(1050121) && !getPlayer().haveItem(1050122) && !getPlayer().haveItem(1050113))
/* 3170 */       return 5; 
/* 3171 */     if (getPlayer().getGender() == 1 && !getPlayer().haveItem(1051129) && !getPlayer().haveItem(1051130) && !getPlayer().haveItem(1051114))
/* 3172 */       return 5; 
/* 3173 */     if (!getPlayer().haveItem(1112001)) {
/* 3174 */       return 6;
     }
/* 3176 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 3177 */       if (chr.getId() == getPlayer().getId()) {
         continue;
       }
/* 3180 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 3181 */       if (curChar == null)
/* 3182 */         return 2; 
/* 3183 */       if (curChar.getMarriageId() > 0)
/* 3184 */         return 3; 
/* 3185 */       if (curChar.getGender() == getPlayer().getGender())
/* 3186 */         return 4; 
/* 3187 */       if (curChar.getGender() == 0 && !curChar.haveItem(1050121) && !curChar.haveItem(1050122) && !curChar.haveItem(1050113))
/* 3188 */         return 5; 
/* 3189 */       if (curChar.getGender() == 1 && !curChar.haveItem(1051129) && !curChar.haveItem(1051130) && !curChar.haveItem(1051114))
/* 3190 */         return 5; 
/* 3191 */       if (!curChar.haveItem(1112001)) {
/* 3192 */         return 6;
       }
     }
/* 3195 */     return 9;
   }




   public int getPartyFormID() {
/* 3202 */     int curCharID = -1;
/* 3203 */     if (getPlayer().getParty() == null) {
/* 3204 */       curCharID = -1;
/* 3205 */     } else if (getPlayer().getMarriageId() > 0) {
/* 3206 */       curCharID = -2;
/* 3207 */     } else if (getPlayer().getParty().getMembers().size() != 2) {
/* 3208 */       curCharID = -3;
     }
/* 3210 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 3211 */       if (chr.getId() == getPlayer().getId()) {
         continue;
       }
/* 3214 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 3215 */       if (curChar == null) {
/* 3216 */         curCharID = -4; continue;
       }
/* 3218 */       curCharID = chr.getId();
     }

/* 3221 */     return curCharID;
   }






   public int getGMLevel() {
/* 3230 */     return getClient().getPlayer().getGMLevel();
   }






   public void startLieDetector(boolean isItem) {
/* 3239 */     getClient().getPlayer().startLieDetector(isItem);
   }






   public int getReborns() {
/* 3248 */     return getClient().getPlayer().getReborns();
   }






   public void setReborns(int val) {
/* 3257 */     getClient().getPlayer().setReborns(val);
   }






   public int getReborns1() {
/* 3266 */     return getClient().getPlayer().getReborns1();
   }






   public void setReborns1(int val) {
/* 3275 */     getClient().getPlayer().setReborns1(val);
   }






   public int getReborns2() {
/* 3284 */     return getClient().getPlayer().getReborns2();
   }






   public void setReborns2(int val) {
/* 3293 */     getClient().getPlayer().setReborns2(val);
   }






   public int getReborns3() {
/* 3302 */     return getClient().getPlayer().getReborns3();
   }






   public void setReborns3(int val) {
/* 3311 */     getClient().getPlayer().setReborns3(val);
   }






   public void gainReborns(int rebornsField) {
/* 3320 */     getClient().getPlayer().gainReborns(rebornsField);
   }






   public void doReborn(int rebornsField) {
/* 3329 */     getClient().getPlayer().doReborn(rebornsField);
   }







   public void doReborn(int rebornsField, int ap) {
/* 3339 */     getClient().getPlayer().doReborn(rebornsField, ap);
   }







   public void spouseMessage(int op, String msg) {
/* 3349 */     getClient().announce(MaplePacketCreator.spouseMessage(op, msg));
   }







   public void sendPolice(String text, boolean dc) {
/* 3359 */     if (dc) {
/* 3360 */       getClient().getPlayer().sendPolice(text);
     } else {
/* 3362 */       getClient().announce(MaplePacketCreator.sendPolice(text));
     }
   }







   public void givePartyHonorExp(int gain, boolean show) {
/* 3373 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 3374 */       getClient().getPlayer().gainHonor(gain);
/* 3375 */       if (show) {
/* 3376 */         getClient().announce(MaplePacketCreator.spouseMessage(1, "扎比埃尔的悄悄话：阿斯旺剩下的希拉残党全部消灭掉啦？刚来了一些新东西，你可以来看看。说不定你能用得上～"));
       }
       return;
     }
/* 3380 */     int cMap = getPlayer().getMapId();
/* 3381 */     for (MaplePartyCharacter chr : getPlayer().getParty().getMembers()) {
/* 3382 */       MapleCharacter curChar = getChannelServer().getPlayerStorage().getCharacterById(chr.getId());
/* 3383 */       if (curChar != null && (curChar.getMapId() == cMap || curChar.getEventInstance() == getPlayer().getEventInstance())) {
/* 3384 */         curChar.gainHonor(gain);
/* 3385 */         if (show) {
/* 3386 */           curChar.getClient().announce(MaplePacketCreator.spouseMessage(1, "扎比埃尔的悄悄话：阿斯旺剩下的希拉残党全部消灭掉啦？刚来了一些新东西，你可以来看看。说不定你能用得上～"));
         }
       }
     }
   }






   public String getTime() {
/* 3398 */     return DateUtil.getNowTime();
   }

   public boolean checkPartyEvent(int minLevel, int maxLevel, int minPartySize, int maxPartySize, int itemId) {
/* 3402 */     MapleParty party = getClient().getPlayer().getParty();
/* 3403 */     if (party == null || party.getMembers().size() < minPartySize || party.getLeader().getId() != getClient().getPlayer().getId()) {
/* 3404 */       return false;
     }
/* 3406 */     int inMap = 0;
/* 3407 */     boolean next = true;
/* 3408 */     int checkMapId = getPlayer().getMapId();
/* 3409 */     for (MaplePartyCharacter cPlayer : party.getMembers()) {
/* 3410 */       MapleCharacter ccPlayer = getPlayer().getMap().getCharacterById(cPlayer.getId());
/* 3411 */       if (ccPlayer != null && ccPlayer.getLevel() >= minLevel && ccPlayer.getLevel() <= maxLevel && ccPlayer.getMapId() == checkMapId && ccPlayer.haveItem(itemId)) {
/* 3412 */         inMap++; continue;
       }
/* 3414 */       return false;
     }

/* 3417 */     if (party.getMembers().size() > maxPartySize || inMap < minPartySize) {
/* 3418 */       next = false;
     }
/* 3420 */     return next;
   }

   public int getPlayerPoints() {
/* 3424 */     return getClient().getPlayer().getPlayerPoints();
   }

   public void setPlayerPoints(int gain) {
/* 3428 */     getClient().getPlayer().setPlayerPoints(gain);
   }

   public void gainPlayerPoints(int gain) {
/* 3432 */     getClient().getPlayer().gainPlayerPoints(gain);
   }

   public int getPlayerEnergy() {
/* 3436 */     return getClient().getPlayer().getPlayerEnergy();
   }

   public void setPlayerEnergy(int gain) {
/* 3440 */     getClient().getPlayer().setPlayerEnergy(gain);
   }

   public void gainPlayerEnergy(int gain) {
/* 3444 */     getClient().getPlayer().gainPlayerEnergy(gain);
   }







   public int getEventCount(String eventId) {
/* 3454 */     return getClient().getPlayer().getEventCount(eventId);
   }

   public int getEventCount(String eventId, int type) {
/* 3458 */     return getClient().getPlayer().getEventCount(eventId, type);
   }






   public void setEventCount(String eventId) {
/* 3467 */     getClient().getPlayer().setEventCount(eventId);
   }

   public void setEventCount(String eventId, int type) {
/* 3471 */     getClient().getPlayer().setEventCount(eventId, type);
   }

   public void setEventCount(String eventId, int type, int count) {
/* 3475 */     getClient().getPlayer().setEventCount(eventId, type, count);
   }






   public void resetEventCount(String eventId) {
/* 3484 */     getClient().getPlayer().resetEventCount(eventId);
   }

   public void resetEventCount(String eventId, int type) {
/* 3488 */     getClient().getPlayer().resetEventCount(eventId, type);
   }

   public void setPartyEventCount(String eventId) {
/* 3492 */     setPartyEventCount(eventId, 0);
   }

   public void setPartyEventCount(String eventId, int type) {
/* 3496 */     setPartyEventCount(eventId, type, 1);
   }

   public void setPartyEventCount(String eventId, int type, int count) {
/* 3500 */     if (getPlayer().getParty() == null || getPlayer().getParty().getMembers().size() == 1) {
/* 3501 */       getClient().getPlayer().setEventCount(eventId, type, count);
       return;
     }
/* 3504 */     int checkMap = getPlayer().getMapId();
/* 3505 */     for (MaplePartyCharacter partyPlayer : getPlayer().getParty().getMembers()) {
/* 3506 */       MapleCharacter chr = getPlayer().getMap().getCharacterById(partyPlayer.getId());
/* 3507 */       if (chr != null && chr.getMapId() == checkMap) {
/* 3508 */         chr.setEventCount(eventId, type, count);
       }
     }
   }

   public boolean checkPartyEventCount(String eventId) {
/* 3514 */     return checkPartyEventCount(eventId, 1);
   }

   public boolean checkPartyEventCount(String eventId, int checkcount) {
/* 3518 */     MapleParty party = getClient().getPlayer().getParty();

/* 3520 */     if (party == null || party.getMembers().size() == 1) {
/* 3521 */       int count = getEventCount(eventId);
/* 3522 */       return (count >= 0 && count < checkcount);
     }
/* 3524 */     int check = 0;
/* 3525 */     int partySize = party.getMembers().size();
/* 3526 */     for (MaplePartyCharacter partyPlayer : party.getMembers()) {
/* 3527 */       MapleCharacter chr = getPlayer().getMap().getCharacterById(partyPlayer.getId());
/* 3528 */       if (chr != null) {
/* 3529 */         int count = chr.getEventCount(eventId);
/* 3530 */         if (count >= 0 && count < checkcount) {
/* 3531 */           check++;
         }
       }
     }
/* 3535 */     return (partySize == check);
   }

   public MapleItemInformationProvider getItemInfo() {
/* 3539 */     return MapleItemInformationProvider.getInstance();
   }







   public Equip getNewEquip(int equipid) {
/* 3549 */     Equip equip = (Equip)getItemInfo().getEquipById(equipid);
/* 3550 */     return getItemInfo().randomizeStats(equip);
   }







   public Equip getEquipBySlot(short slot) {
/* 3560 */     return (Equip)getClient().getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot);
   }








   public boolean changeLimitBreak(long amount) {
/* 3571 */     return changeLimitBreak(amount, false);
   }







   public boolean changeLimitBreak(long amount, boolean ex) {
/* 3581 */     Equip equip = (Equip)getClient().getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem((short)-11);
/* 3582 */     if (equip == null || !ItemConstants.isWeapon(equip.getItemId())) {
/* 3583 */       return false;
     }

/* 3586 */     long limitbreak = ex ? equip.getLimitBreakEx() : equip.getLimitBreak();
/* 3587 */     long newLimitBreak = limitbreak + amount;
/* 3588 */     if (newLimitBreak < 0L || (!ex && newLimitBreak > ItemConstants.getLimitBreakSurplus(equip.getItemId()))) {
/* 3589 */       return false;
     }
/* 3591 */     if (ex) {

/* 3593 */       equip.setLimitBreakEx(newLimitBreak);
     } else {
/* 3595 */       equip.setLimitBreak(newLimitBreak);
     }

/* 3598 */     getClient().getPlayer().forceUpdateItem((Item)equip);
/* 3599 */     return true;
   }




   public long getLimitBreak() {
/* 3606 */     return getLimitBreak(false);
   }






   public long getLimitBreakEx() {
/* 3615 */     return getLimitBreak(true);
   }






   public long getTotalLimitBreak() {
/* 3624 */     return getTotalLimitBreak(null, true);
   }







   public long getTotalLimitBreak(boolean addDefault) {
/* 3634 */     return getTotalLimitBreak(null, addDefault);
   }








   public long getTotalLimitBreak(Equip weapon, boolean addDefault) {
/* 3645 */     if (weapon == null) {
/* 3646 */       weapon = (Equip)getClient().getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem((short)-11);
     }
/* 3648 */     return weapon.getTotalLimitBreak() + (addDefault ? MapleItemInformationProvider.getInstance().getLimitBreak(weapon.getItemId()) : 0L);
   }







   public long getLimitBreak(boolean ex) {
/* 3658 */     long limitBreak = 999999L;
/* 3659 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 3660 */     Equip weapon = (Equip)getClient().getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem((short)-11);
/* 3661 */     if (weapon != null)
     {
/* 3663 */       limitBreak = ex ? weapon.getLimitBreakEx() : (ii.getLimitBreak(weapon.getItemId()) + weapon.getLimitBreak());
     }
/* 3665 */     return limitBreak;
   }







   public boolean WeaponLimitBreak(long limitBreak) {
/* 3675 */     Item item = getInventory(-1).getItem((short)-11);
/* 3676 */     if (item != null) {
/* 3677 */       Equip equip = (Equip)item;
/* 3678 */       if (!ItemConstants.isWeapon(equip.getItemId()) || (limitBreak += equip.getLimitBreak()) > ItemConstants.getLimitBreakSurplus(equip.getItemId())) {
/* 3679 */         return false;
       }
/* 3681 */       equip.setLimitBreak(limitBreak);
/* 3682 */       ArrayList<ModifyInventory> arrayList = new ArrayList<>();
/* 3683 */       arrayList.add(new ModifyInventory(3, (Item)equip));
/* 3684 */       arrayList.add(new ModifyInventory(0, (Item)equip));
/* 3685 */       getClient().announce(InventoryPacket.modifyInventory(true, arrayList, getPlayer()));
/* 3686 */       return true;
     }
/* 3688 */     return false;
   }








   public int getRandomPotential(short slot, int potId) {
/* 3699 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 3700 */     Equip equip = (Equip)getClient().getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot);
/* 3701 */     if (equip == null || ii.isCash(equip.getItemId()) || ii.getPotentialInfo(potId) == null) {
/* 3702 */       return -1;
     }
/* 3704 */     List<List<StructItemOption>> pots = new LinkedList<>(ii.getPotentialInfos(40000).values());
/* 3705 */     int reqLevel = ii.getReqLevel(equip.getItemId()) / 10;
/* 3706 */     int count = 0;
/* 3707 */     boolean rewarded = false;
/* 3708 */     while (!rewarded) {
/* 3709 */       count++;
/* 3710 */       StructItemOption pot = ((List<StructItemOption>)pots.get(nextInt(pots.size()))).get(reqLevel);
/* 3711 */       if (pot != null && pot.reqLevel / 10 <= reqLevel && pot.opID == potId) {
/* 3712 */         rewarded = true; continue;
/* 3713 */       }  if (count > 3000) {
/* 3714 */         rewarded = true;
       }
     }
/* 3717 */     return count;
   }










   public boolean changePotential(short slot, int potline, int potId, boolean show) {
/* 3730 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 3731 */     Equip equip = (Equip)getClient().getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot);
/* 3732 */     if (equip == null || ii.isCash(equip.getItemId()) || ii.getPotentialInfo(potId) == null) {
/* 3733 */       return false;
     }
/* 3735 */     if (potline >= 1 && potline <= 6) {
/* 3736 */       equip.setPotential(potId, (potline > 3) ? (potline - 3) : potline, (potline > 3));
/* 3737 */       getClient().getPlayer().forceUpdateItem((Item)equip);
/* 3738 */       if (show) {
/* 3739 */         WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.getGachaponMega(getClient().getPlayer().getName(), " : 使用 一键潜能功能 将装备{" + ii.getName(equip.getItemId()) + "}第" + potline + "条潜能修改.大家一起恭喜他（她）吧！！！！", (Item)equip, 3, getClient().getChannel()));
       }
/* 3741 */       return true;
     }
/* 3743 */     return false;
   }







   public byte getSubcategory() {
/* 3753 */     return getClient().getPlayer().getSubcategory();
   }






   public void setSubcategory(int value) {
/* 3762 */     getClient().getPlayer().setSubcategory(value);
   }

   public final int getActivity() {
/* 3766 */     return MapleActivity.getActivity(getPlayer());
   }

   public final int getMaxActivity() {
/* 3770 */     return MapleActivity.getMaxActivity();
   }

   public final int getDiffActivity() {
/* 3774 */     return MapleActivity.getDiffActivity(getPlayer());
   }

   public final int getNextStage() {
/* 3778 */     return MapleActivity.getNextStage(getPlayer());
   }

   public final void finishActivity(int questid) {
/* 3782 */     MapleActivity.finish(getPlayer(), questid);
   }

   public final int getAQActivity(int questid) {
/* 3786 */     return MapleActivity.QuestActivity.getActivityById(questid);
   }

   public final int getAQMaxTimes(int questid) {
/* 3790 */     return MapleActivity.QuestActivity.getMaxTimesById(questid);
   }

   public final int getAQNextStageNeed() {
/* 3794 */     return MapleActivity.getNextStageNeed(getPlayer());
   }

   public final int getRecevieReward() {
/* 3798 */     return MapleActivity.getRecevieReward(getPlayer());
   }

   public List<Integer> getSevenDayPayLog(int day) {
/* 3802 */     List<Integer> ret = new ArrayList<>();
/* 3803 */     for (int i = 0; i < day; i++) {
/* 3804 */       ret.add(Integer.valueOf(0));
     }
/* 3806 */     try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
/* 3807 */       PreparedStatement ps = con.prepareStatement("SELECT * FROM paylog WHERE account = ?");
/* 3808 */       ps.setString(1, getAccountName());
/* 3809 */       ResultSet rs = ps.executeQuery();

/* 3811 */       Timestamp currtime = new Timestamp(System.currentTimeMillis());
/* 3812 */       while (rs.next()) {
/* 3813 */         int rmb = rs.getInt("rmb");
/* 3814 */         Timestamp time = rs.getTimestamp("paytime");
/* 3815 */         int diffday = (int)((currtime.getTime() - time.getTime()) / 86400000L);
/* 3816 */         if (diffday < day) {
/* 3817 */           ret.set(diffday, Integer.valueOf(((Integer)ret.get(diffday)).intValue() + rmb));
         }
       }
/* 3820 */       ps.close();
/* 3821 */       rs.close();
/* 3822 */     } catch (SQLException e) {
/* 3823 */       System.err.println("获取充值记录失败" + e);
     }
/* 3825 */     return ret;
   }



































   public final boolean MissionCanMake(int missionid) {
/* 3863 */     return getPlayer().MissionCanMake(missionid);
   }








   public final boolean MissionCanMake(int missionid, int checktype) {
/* 3874 */     return getPlayer().MissionCanMake(missionid, checktype);
   }








   public final int MissionGetIntData(int missionid, int checktype) {
/* 3885 */     return getPlayer().MissionGetIntData(missionid, checktype);
   }








   public final String MissionGetStrData(int missionid, int checktype) {
/* 3896 */     return getPlayer().MissionGetStrData(missionid, checktype);
   }







   public final String MissionGetJoblist(String joblist) {
/* 3906 */     return getPlayer().MissionGetJoblist(joblist);
   }











   public final void MissionMake(int charid, int missionid, int repeat, int repeattime, int lockmap, int mobid) {
/* 3920 */     getPlayer().MissionMake(charid, missionid, repeat, repeattime, lockmap, mobid);
   }










   public final void MissionReMake(int charid, int missionid, int repeat, int repeattime, int lockmap) {
/* 3933 */     getPlayer().MissionReMake(charid, missionid, repeat, repeattime, lockmap);
   }







   public final void MissionFinish(int charid, int missionid) {
/* 3943 */     getPlayer().MissionFinish(charid, missionid);
   }







   public final void MissionDelete(int charid, int missionid) {
/* 3953 */     getPlayer().MissionDelete(charid, missionid);
   }








   public final void MissionSetMinNum(int charid, int missionid, int num) {
/* 3964 */     getPlayer().MissionSetMinNum(charid, missionid, num);
   }









   public final int MissionGetMinNum(int charid, int missionid, int mobid) {
/* 3976 */     return getPlayer().MissionGetMinNum(charid, missionid, mobid);
   }

   public final int MissionGetMaxNum(int charid, int missionid, int mobid) {
/* 3980 */     return getPlayer().MissionGetMaxNum(charid, missionid, mobid);
   }

   public final int MissionGetMobId(int charid, int missionid) {
/* 3984 */     return getPlayer().MissionGetMobId(charid, missionid);
   }

   public final void MissionSetMobId(int charid, int missionid, int mobid) {
/* 3988 */     getPlayer().MissionSetMobId(charid, missionid, mobid);
   }

   public final int MissionGetFinish(int charid, int missionid) {
/* 3992 */     return getPlayer().MissionGetFinish(charid, missionid);
   }







   public final void MissionMaxNum(int missionid, int maxnum) {
/* 4002 */     getPlayer().MissionMaxNum(missionid, maxnum);
   }






   public final void MissionDeleteNotFinish(int charid) {
/* 4011 */     getPlayer().MissionDeleteNotFinish(charid);
   }










   public final boolean MissionStatus(int charid, int missionid, int maxtimes, int checktype) {
/* 4024 */     return getPlayer().MissionStatus(charid, missionid, maxtimes, checktype);
   }

   public final long MissionGetRepeattime(int charid, int missionid) {
/* 4028 */     return getPlayer().MissionGetRepeattime(charid, missionid);
   }

   public final void MissionAddMinNum(int charid, int missionid, int num) {
/* 4032 */     getPlayer().MissionAddMinNum(charid, missionid, num);
   }






   public int getRMB() {
/* 4041 */     return getPlayer().getRMB();
   }






   public void setRMB(int rmb) {
/* 4050 */     getPlayer().setRMB(rmb);
   }






   public void gainRMB(int rmb) {
/* 4059 */     getPlayer().gainRMB(rmb);
   }






   public int getTotalRMB() {
/* 4068 */     return getPlayer().getTotalRMB();
   }







   public List<Pair<String, Integer>> getTotalRMBRanking(int limit) {
/* 4078 */     return getPlayer().getTotalRMBRanking(limit);
   }

   public int getMapleEquipOnlyId() {
/* 4082 */     return MapleEquipOnlyId.getInstance().getNextEquipOnlyId();
   }







   public void addFromDrop(Item item, boolean show) {
/* 4092 */     MapleInventoryManipulator.addFromDrop(getClient(), item, show);
   }

   public void addFromDrop(MapleClient c, Item item, boolean show) {
/* 4096 */     MapleInventoryManipulator.addFromDrop(getClient(), item, show);
   }







   public Connection getConnection() throws SQLException {
/* 4106 */     return (Connection)DatabaseConnection.getInstance().getConnection();
   }

   public final Item newItem(int id, byte position, short quantity) {
/* 4110 */     return new Item(id, (short)position, quantity);
   }

   public final Item newItem(int id, byte position, short quantity, short flag) {
/* 4114 */     return new Item(id, (short)position, quantity, flag);
   }

   public final void addByItem(Item item) {
/* 4118 */     MapleInventoryManipulator.addbyItem(getClient(), item);
   }

   public void changeDamageSkin(int id) {
/* 4122 */     getPlayer().changeDamageSkin(id);
   }

   public void updateSubmitBug(int id, int status) {
/* 4126 */     try(DruidPooledConnection con = DatabaseConnection.getInstance().getConnection(); 
/* 4127 */         PreparedStatement ps = con.prepareStatement("UPDATE buglog SET status = ? WHERE id = ?")) {
/* 4128 */       ps.setInt(1, status);
/* 4129 */       ps.setInt(2, id);
/* 4130 */       ps.executeUpdate();
     }
/* 4132 */     catch (SQLException e) {
/* 4133 */       log.error(e.getMessage());
     }
   }

   public void submitBug(String title, String content) {
/* 4138 */     try(DruidPooledConnection con = DatabaseConnection.getInstance().getConnection(); 
/* 4139 */         PreparedStatement ps = con.prepareStatement("INSERT INTO buglog VALUES (DEFAULT, ?, ?, ?, DEFAULT)")) {
/* 4140 */       ps.setInt(1, getPlayer().getId());
/* 4141 */       ps.setString(2, title);
/* 4142 */       ps.setString(3, content);
/* 4143 */       ps.executeUpdate();
     }
/* 4145 */     catch (SQLException e) {
/* 4146 */       log.error(e.getMessage());
     }
   }

   public List<Quadruple> getSubmitBug() {
/* 4151 */     List<Quadruple> buglist = new LinkedList<>();
/* 4152 */     try(DruidPooledConnection con = DatabaseConnection.getInstance().getConnection(); 
/* 4153 */         PreparedStatement ps = con.prepareStatement("SELECT * FROM buglog WHERE charid = ?")) {
/* 4154 */       ps.setInt(1, getPlayer().getId());
/* 4155 */       try (ResultSet rs = ps.executeQuery()) {
/* 4156 */         while (rs.next()) {
/* 4157 */           buglist.add(new Quadruple(Integer.valueOf(rs.getInt("id")), rs.getString("title"), rs.getString("content"), Integer.valueOf(rs.getInt("status"))));
         }
       }

/* 4161 */     } catch (SQLException e) {
/* 4162 */       log.error(e.toString());
     }
/* 4164 */     return buglist;
   }

   public RankingTop getRankingTopInstance() {
/* 4168 */     return RankingTop.getInstance();
   }

   public final MapleMonster getMonster(int mobid) {
/* 4172 */     return MapleLifeFactory.getMonster(mobid);
   }









   public final OverrideMonsterStats getOverrideMonsterStats(long hp, int mp, int exp) {
/* 4184 */     return new OverrideMonsterStats(hp, mp, exp);
   }

   public final long getNextDayDiff(int day) {
/* 4188 */     return DateUtil.getNextDayDiff(day);
   }

   public final void getShowItemGain(int itemId, short quantity, boolean inChat) {
/* 4192 */     getClient().announce(MaplePacketCreator.getShowItemGain(itemId, quantity, inChat));
   }

   public final void insertRanking(String rankingname, int value) {
/* 4196 */     RankingTop.getInstance().insertRanking(getPlayer(), rankingname, value);
   }

   public final List<RankingTop.CharNameAndId> getRanking(String rankingname) {
/* 4200 */     return RankingTop.getInstance().getRanking(rankingname);
   }

   public final List<RankingTop.CharNameAndId> getRanking(String rankingname, int previous) {
/* 4204 */     return RankingTop.getInstance().getRanking(rankingname, previous);
   }

   public final List<RankingTop.CharNameAndId> getRanking(String rankingname, int previous, boolean repeatable) {
/* 4208 */     return RankingTop.getInstance().getRanking(rankingname, previous, repeatable);
   }








   public void getNpcNotice(int npcid, String text, int time) {
/* 4219 */     getClient().getPlayer().getNpcNotice(npcid, text, time);
   }







   public void setCredit(String name, int value) {
/* 4229 */     getClient().getPlayer().setCredit(name, value);
   }







   public void gainCredit(String name, int value) {
/* 4239 */     getClient().getPlayer().gainCredit(name, value);
   }







   public int getCredit(String name) {
/* 4249 */     return getClient().getPlayer().getCredit(name);
   }

   public int getWp() {
/* 4253 */     return getClient().getPlayer().getWeaponPoint();
   }

   public void setWp(int wp) {
/* 4257 */     getClient().getPlayer().setWeaponPoint(wp);
   }

   public void gainWp(int wp) {
/* 4261 */     getClient().getPlayer().gainWeaponPoint(wp);
   }

   public MapleMonsterInformationProvider getMonsterInfo() {
/* 4265 */     return MapleMonsterInformationProvider.getInstance();
   }




   public void enterCS() {
/* 4272 */     InterServerHandler.enterCS(getClient(), getClient().getPlayer(), true);
   }




   public void enterMTS() {
/* 4279 */     InterServerHandler.enterCS(getClient(), getClient().getPlayer(), false, false);
   }







   public void playMovie(String data, boolean show) {
/* 4289 */     getClient().announce(UIPacket.playMovie(data, show));
   }






   public void openUI(int id) {
/* 4298 */     getClient().announce(UIPacket.sendOpenWindow(id));
   }







   public void putGeneralData(String key, String value) {
/* 4308 */     try(DruidPooledConnection con = DatabaseConnection.getInstance().getConnection(); 
/* 4309 */         PreparedStatement ps = con.prepareStatement("INSERT general_data (`key`, value) VALUES (?, ?) ON DUPLICATE KEY UPDATE value = ?")) {
/* 4310 */       ps.setString(1, key);
/* 4311 */       ps.setString(2, value);
/* 4312 */       ps.setString(3, value);
/* 4313 */       ps.executeUpdate();
     }
/* 4315 */     catch (SQLException e) {
/* 4316 */       log.error("添加通用数据失败", e);
     }
   }






   public void removeGeneralData(String key) {
/* 4326 */     try(DruidPooledConnection con = DatabaseConnection.getInstance().getConnection(); 
/* 4327 */         PreparedStatement ps = con.prepareStatement("DELETE FROM general_data WHERE `key` = ?")) {
/* 4328 */       ps.setString(1, key);
/* 4329 */       ps.executeUpdate();
     }
/* 4331 */     catch (SQLException e) {
/* 4332 */       log.error("删除通用数据失败", e);
     }
   }







   public JSONObject getGeneralData(String key) {
    try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
        try (PreparedStatement ps = con.prepareStatement("SELECT `value` FROM general_data WHERE `key` = ?")) {
            ps.setString(1, key);
            try (ResultSet rs = ps.executeQuery()) {
                if (rs.next()) {
                    return new JSONObject(rs.getString("value"));
                } else {
                    return new JSONObject();
                }
            }
        }
    } catch (SQLException e) {
        log.error("获得通用数据失败", e);
        return new JSONObject();
    }
   }


















   public void updatePet(Object object) {}

















   public boolean changePetColor(int index) {
/* 4396 */     MaplePet pet = getPlayer().getSpawnPet(index);
/* 4397 */     if (pet != null) {
/* 4398 */       pet.setColor(nextInt(153));
/* 4399 */       getPlayer().getMap().broadcastMessage(PetPacket.changePetColor(getPlayer(), pet));
/* 4400 */       return true;
     }
/* 4402 */     return false;
   }

   public List<MaplePet> getSummonedPet() {
/* 4406 */     return getPlayer().getSummonedPets();
   }

   public final boolean canSpawn(int mapid, Point point) {
/* 4410 */     return (getMap(mapid).getFootholds().findBelow(point, false) != null);
   }


   public void checkMedalQuest() {
/* 4415 */     MapScriptMethods.explorationPoint(getClient());
   }

   public boolean checkPartyMemberNearby(Point point) {
/* 4419 */     return (getPlayer().getParty() != null && getPlayer().getParty().getMembers().parallelStream().map(partyCharacter -> getPlayer().getMap().getCharacterById(partyCharacter.getId())).allMatch(player -> (player == null || player.getTruePosition().distanceSq(point) <= 800.0D)));
   }

   public int deleteCharacter(int cid) {
/* 4423 */     return getClient().deleteCharacter(cid);
   }






   public void dispelBuff(int skillid) {
/* 4432 */     getPlayer().dispelBuff(skillid);
   }

   public void displayNode(MapleMonster mob) {
/* 4436 */     if (mob != null) {
/* 4437 */       mob.switchController(getPlayer(), false);
/* 4438 */       getClient().announce(MobPacket.mobEscortReturnBefore(mob, getMap()));
     }
   }

   public void EventGainNX() {
/* 4443 */     gainNX((int)(getPlayer().getParty().getAverageLevel() / 250.0D * 3000.0D));
   }

   public final void fieldGravefall(int count, int type1, int type2) {
/* 4447 */     getMap().broadcastMessage(getPlayer(), MaplePacketCreator.createObtacleAtom(count, type1, type2, getMap()), true);
   }




   public final void gainPQPoint() {
/* 4454 */     if (getPlayer() == null) {
       return;
     }
/* 4457 */     long l2 = (int)((Randomizer.rand(25, 50) * getLevel()) * 1.5D);
/* 4458 */     getPlayer().gainPQPoint(l2);
/* 4459 */     getPlayer().dropMessage(-9, "获得了" + l2 + "组队点数!");
   }







   public final void gainQuestPoint(int questid, long point) {
/* 4469 */     if (getPlayer() != null) {
/* 4470 */       getPlayer().gainPQPoint(questid, point);
/* 4471 */       String s = "";
/* 4472 */       switch (questid) {
         case 7907:
/* 4474 */           s = "组队";
           break;

         case 42003:
/* 4478 */           s = "起源";
           break;
       }

/* 4482 */       dropMessage(-9, ((point > 0L) ? "获得了 " : "消耗了") + Math.abs(point) + "点" + s + "点数!");
     }
   }







   public final long getQuestPoint(int questid) {
/* 4493 */     if (getPlayer() != null) {
/* 4494 */       return getPlayer().getPQPoint(questid);
     }
/* 4496 */     return -1L;
   }






   public boolean gainSailBouns() {
/* 4505 */     int n2 = getSailCoins();
/* 4506 */     if (getPlayer().canHold(4310100)) {
/* 4507 */       getPlayer().gainItem(4310100, n2, "航海奖励领取");
/* 4508 */       getPlayer().updateInfoQuest(17011, "");
/* 4509 */       return true;
     }
/* 4511 */     return false;
   }






   public int getSailStat() {
/* 4520 */     String string = getPlayer().getOneInfo(17011, "S");
/* 4521 */     if (string != null) {
/* 4522 */       return Integer.valueOf(string).intValue();
     }
/* 4524 */     return -1;
   }






   public int getSailCoins() {
/* 4533 */     String string = getPlayer().getOneInfo(17011, "C");
/* 4534 */     if (string != null) {
/* 4535 */       return Integer.valueOf(string).intValue();
     }
/* 4537 */     return 0;
   }




   public void setCanSail() {
/* 4544 */     getPlayer().doneSailQuestion();
   }

   public void GainSpecial(int type) {
/* 4548 */     switch (type) {
       case 1:
/* 4550 */         if (nextInt(100) >= 15)
/* 4551 */           break;  gainItem(ItemConstants.fa()[nextInt((ItemConstants.fa()).length)], (short)1);
         break;

       case 2:
/* 4555 */         if (nextInt(100) >= 15)
/* 4556 */           break;  gainItem(ItemConstants.fb()[nextInt((ItemConstants.fb()).length)], (short)1);
         break;

       case 3:
/* 4560 */         if (nextInt(100) >= 15)
/* 4561 */           break;  gainItem(ItemConstants.fc()[nextInt((ItemConstants.fc()).length)], (short)5);
         break;
     }
   }






   public final String getAccountName() {
/* 4572 */     return getClient().getAccountName();
   }

   public List<Item> getCashItemlist() {
/* 4576 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 4577 */     MapleInventory items = getPlayer().getInventory(MapleInventoryType.EQUIP);
/* 4578 */     ArrayList<Item> ret = new ArrayList<>();
/* 4579 */     for (Item item : items) {
/* 4580 */       if (ii.isCash(item.getItemId())) {
/* 4581 */         ret.add(item);
       }
     }
/* 4584 */     return ret;
   }

   public boolean Singin() {
/* 4588 */     int n2 = getSinginCount();
/* 4589 */     Timestamp timestamp = new Timestamp(System.currentTimeMillis());
/* 4590 */     try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
/* 4591 */       try (PreparedStatement ps = con.prepareStatement("SELECT `count` , `lastdate` FROM singin WHERE characterid = ?")) {
/* 4592 */         ps.setInt(1, getPlayer().getId());
/* 4593 */         try (ResultSet rs = ps.executeQuery()) {
/* 4594 */           if (rs.next()) {

/* 4596 */             Timestamp timestamp2 = rs.getTimestamp("lastdate");
/* 4597 */             boolean bl3 = (getPlayer().getDaybyDay(0).getTimeInMillis() - timestamp2.getTime() > 0L);
/* 4598 */             long l2 = timestamp2.getTime() - getPlayer().getDaybyDay(-1).getTimeInMillis();
/* 4599 */             boolean bl2 = (l2 <= 86400000L && l2 >= 0L), bl4 = bl2;
/* 4600 */             if (bl3) {
/* 4601 */               try (PreparedStatement preparedStatement = con.prepareStatement("UPDATE singin SET lastdate = ?, count = ? WHERE characterid = ?")) {
/* 4602 */                 preparedStatement.setTimestamp(1, timestamp);
/* 4603 */                 preparedStatement.setInt(2, (bl2 && n2 < 31) ? (rs.getInt("count") + 1) : 1);
/* 4604 */                 preparedStatement.setInt(3, getPlayer().getId());
/* 4605 */                 preparedStatement.executeUpdate();
               }
/* 4607 */               return true;
             }
/* 4609 */             return false;
           }
         }
       }
/* 4613 */       try (PreparedStatement preparedStatement = con.prepareStatement("INSERT INTO singin (characterid, lastdate, count) VALUES (?, ?, ?)")) {
/* 4614 */         preparedStatement.setInt(1, getPlayer().getId());
/* 4615 */         preparedStatement.setTimestamp(2, timestamp);
/* 4616 */         preparedStatement.setInt(3, 1);
/* 4617 */         preparedStatement.execute();
       }
/* 4619 */       return true;
/* 4620 */     } catch (SQLException e) {
/* 4621 */       log.error("签到出现错误", e);
/* 4622 */       return false;
     }
   }






   public int getSinginCount() {
    try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
        try (PreparedStatement ps = con.prepareStatement("SELECT `count` FROM singin WHERE characterid = ?")) {
            ps.setInt(1, this.getPlayer().getId());
            try (ResultSet rs = ps.executeQuery()) {
                if (!rs.next()) return 0;
                {
                    return rs.getInt("count");
                }
            }
        }
    } catch (SQLException e) {
        log.error("签到出现错误", e);
    }
    return 0;
   }
   public void getChoiceText(byte type, byte mode, int npc) {
/* 4649 */     getClient().announce(NPCPacket.getNPCTalkText(type, mode, npc));
   }

   public List<MapleCharacter> getchrlist() {
/* 4653 */     return getClient().loadCharacters(getPlayer().getWorld());
   }






   public int getOnlineTime() {
/* 4662 */     return getPlayer().getOnlineTime() / 60000;
   }




   public void setOnlineTime() {
/* 4669 */     getPlayer().setOnlineTime(System.currentTimeMillis());
   }






   public int getTodayOnlineTime() {
/* 4678 */     return getPlayer().getTodayOnlineTime();
   }




   public void initTodayOnlineTime() {
/* 4685 */     getPlayer().initTodayOnlineTime();
   }

   public final void spawnNpcForPlayer(int mapid, int id, Point pos) {
/* 4689 */     getMap(mapid).spawnNpcForPlayer(getClient(), id, pos);
   }

   public final Point getSpawnPoint(int mapid) {
/* 4693 */     ArrayList<Point> arrayList = new ArrayList<>();
/* 4694 */     MapleMap map = getMap(mapid);
/* 4695 */     map.getFootholds().getAllRelevants().forEach(p2 -> arrayList.add(new Point(Randomizer.rand(map.getLeft(), map.getRight()), p2.getY2())));

/* 4697 */     return arrayList.get(nextInt(arrayList.size()));
   }

   public void onUserEnter(String onUserEnter) {
/* 4701 */     if (getParty() != null) {
/* 4702 */       for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 4703 */         MapleCharacter player = getPlayer().getMap().getCharacterById(partyCharacter.getId());
/* 4704 */         if (player == null)
/* 4705 */           continue;  MapScriptMethods.startScript_FirstUser(player.getClient(), onUserEnter);
       }
     }
   }

   public void openMapScript(String onUserEnter) {
/* 4711 */     getClient().removeClickedNPC();
/* 4712 */     MapScriptMethods.startScript_FirstUser(getClient(), onUserEnter);
   }

   public boolean giveWeaponByLevel(int level) {
/* 4716 */     ArrayList<Integer> arrayList = new ArrayList<>();
/* 4717 */     MapleItemInformationProvider ii = getItemInfo();
/* 4718 */     ii.getAllItemNames().entrySet().parallelStream().forEach(stringStringEntry -> {
           int itemId = Integer.valueOf(((Integer)stringStringEntry.getKey()).intValue()).intValue();



           String name = (String)stringStringEntry.getValue();


           if (!name.contains("枫叶") && !name.contains("游泳") && !name.contains("国旗") && !name.contains("周年") && itemId % 100 >= 0 && ii.getReqLevel(itemId) == level && getPlayer().isMainWeapon(getJob(), itemId) && ii.isEquipTradeBlock(itemId)) {
             arrayList.add(Integer.valueOf(itemId));
           }
         });


/* 4732 */     if (arrayList.size() > 0) {
/* 4733 */       gainItem(((Integer)arrayList.get(nextInt(arrayList.size()))).intValue(), (short)1);
/* 4734 */       return true;
     }
/* 4736 */     return false;
   }






   public boolean isAdmin() {
/* 4745 */     return getPlayer().isAdmin();
   }

   public boolean isGMS() {
/* 4749 */     return false;
   }






   public boolean isMarried() {
/* 4758 */     return (getPlayer().getMarriageId() > 0);
   }

   public void sendMarriedBefore() {
/* 4762 */     EventInstanceManager eim = getEventInstance();
/* 4763 */     if (eim != null) {
/* 4764 */       int ringid1 = Integer.valueOf(eim.getProperty("male")).intValue();
/* 4765 */       int ringid2 = Integer.valueOf(eim.getProperty("female")).intValue();
/* 4766 */       getPlayer().getMap().broadcastMessage(MaplePacketCreator.sendMarriedBefore(ringid1, ringid2));
     }
   }

   public void nextNodeAction(int mobid, int time) {
/* 4771 */     getMap().nextNodeAction(mobid, time);
   }

   public void outputFileError(Throwable throwable) {
/* 4775 */     log.error("脚本异常", throwable);
   }

   public void sendRemoveNPC(int npcid) {
/* 4779 */     getClient().announce(NPCPacket.removeNPC(npcid));
   }

   public void sendPyramidEnergy(String object, String amount) {
/* 4783 */     getPlayer().writeEnergy(object, amount);
   }

   public void spawnPortal() {
/* 4787 */     getClient().announce(MaplePacketCreator.spawnPortal(999999999, 999999999, 0, null));
   }

   public void spawnNPCRequestController(int npcid, int x, int y) {
/* 4791 */     spawnNPCRequestController(npcid, x, y, 0);
   }


   public void spawnNPCRequestController(int npcid, int x, int y, int f) {
/* 4796 */     if (npcs.containsKey(new Pair(Integer.valueOf(npcid), this.c)))
/* 4797 */       npcs.remove(new Pair(Integer.valueOf(npcid), this.c)); 
     MapleNPC npc;
/* 4799 */     if ((npc = MapleLifeFactory.getNPC(npcid, getMapId())) == null) {
       return;
     }
/* 4802 */     npc.setPosition(new Point(x, y));
/* 4803 */     npc.setCy(y);
/* 4804 */     npc.setRx0(x - 50);
/* 4805 */     npc.setRx1(x + 50);
/* 4806 */     npc.setF(f);
/* 4807 */     npc.setFh(getMap().getFootholds().findBelow(new Point(x, y), false).getId());
/* 4808 */     npc.setCustom(true);
/* 4809 */     npc.setObjectId(npcid);
/* 4810 */     npcs.put(new Pair(Integer.valueOf(npcid), this.c), npc);
/* 4811 */     getClient().announce(NPCPacket.spawnNPCRequestController(npc, true));
   }

   public void setNPCSpecialAction(int npcid, String action) {
/* 4815 */     if (!npcs.containsKey(new Pair(Integer.valueOf(npcid), this.c))) {
       return;
     }
/* 4818 */     MapleNPC npc = npcs.get(new Pair(Integer.valueOf(npcid), this.c));
/* 4819 */     getClient().announce(NPCPacket.setNPCSpecialAction(npc.getObjectId(), action));
   }

   public void updateNPCSpecialAction(int npcid, int value, int x, int y) {
/* 4823 */     if (!npcs.containsKey(new Pair(Integer.valueOf(npcid), this.c))) {
       return;
     }
/* 4826 */     MapleNPC npc = npcs.get(new Pair(Integer.valueOf(npcid), this.c));
/* 4827 */     getClient().announce(NPCPacket.updateNPCSpecialAction(npc.getObjectId(), value, x, y));
   }

   public void getNPCDirectionEffect(int npcid, String data, int value, int x, int y) {
/* 4831 */     if (!npcs.containsKey(new Pair(Integer.valueOf(npcid), this.c))) {
       return;
     }
/* 4834 */     MapleNPC npc = npcs.get(new Pair(Integer.valueOf(npcid), this.c));
/* 4835 */     getClient().announce(UIPacket.getDirectionEffect(data, value, x, y, npc.getObjectId()));
   }

   public void removeNPCRequestController(int npcid) {
/* 4839 */     if (!npcs.containsKey(new Pair(Integer.valueOf(npcid), this.c))) {
       return;
     }
/* 4842 */     MapleNPC npc = npcs.get(new Pair(Integer.valueOf(npcid), this.c));
/* 4843 */     getClient().announce(NPCPacket.removeNPCController(npc.getObjectId(), false));
/* 4844 */     sendRemoveNPC(npc.getObjectId());
/* 4845 */     npcs.remove(new Pair(Integer.valueOf(npcid), this.c));
   }

   public void enableActions() {
/* 4849 */     getClient().announce(MaplePacketCreator.enableActions());
   }

   public void spawnReactorOnGroundBelow(int id, int x, int y) {
/* 4853 */     getMap().spawnReactorOnGroundBelow(new MapleReactor(MapleReactorFactory.getReactor(id), id), new Point(x, y));
   }

   public void removeNPCController(int npcid) {
/* 4857 */     if (!npcs.containsKey(new Pair(Integer.valueOf(npcid), this.c))) {
       return;
     }
/* 4860 */     MapleNPC npc = npcs.get(new Pair(Integer.valueOf(npcid), this.c));
/* 4861 */     getClient().announce(NPCPacket.removeNPCController(npc.getObjectId(), false));
   }

   public void sendESLab() {
/* 4865 */     openUI(100);
   }

   public void sendSceneUI() {
/* 4869 */     getClient().announce(UIPacket.sendSceneUI());
   }

   public void sendUIWindow(int op, int npc) {
/* 4873 */     getClient().announce(UIPacket.sendUIWindow(op, npc));
   }

   public void setDirection(int z) {
/* 4877 */     setDirection(z);
   }

   public void showVisitorResult(int type) {
/* 4881 */     getClient().announce(MaplePacketCreator.showVisitorResult(type));
   }

   public void showVisitoKillResult(int total) {
/* 4885 */     getPlayer().updateVisitorKills(0, total);
   }

   public void showEventMesssage(int type, int dally, String text) {
/* 4889 */     getClient().announce(UIPacket.getMapEffectMsg(text, type, dally));
   }

   public void showPQEffect(int type, String str, String count) {
/* 4893 */     getMap().broadcastMessage(getPlayer(), UIPacket.showPQEffect(type, str, count), true);
   }

   public void showScreenShaking(int mapID, boolean stop) {
/* 4897 */     getClient().announce(UIPacket.screenShake(mapID, stop));
   }

   public void showSetAction(String str, String act) {
/* 4901 */     getMap().broadcastMessage(getPlayer(), MaplePacketCreator.showFieldValue(str, act), true);
   }

   public void updatePartyOneInfo(int questid, String key, String value) {
/* 4905 */     if (getParty() != null) {
/* 4906 */       for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 4907 */         MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 4908 */         if (player == null)
/* 4909 */           continue;  player.updateOneInfo(questid, key, value);
       }
     }
   }

   public void updatePartyInfoQuest(int questid, String data) {
/* 4915 */     updatePartyInfoQuest(questid, data, true);
   }

   public void updatePartyInfoQuest(int questid, String data, boolean check) {
/* 4919 */     if (getParty() != null) {
/* 4920 */       for (MaplePartyCharacter partyCharacter : getParty().getMembers()) {
/* 4921 */         MapleCharacter player = getChannelServer().getPlayerStorage().getCharacterById(partyCharacter.getId());
/* 4922 */         if (player == null || (!player.getInfoQuest(30200).isEmpty() && check))
/* 4923 */           continue;  player.updateInfoQuest(questid, data);
       }
     }
   }







   public int getHyPay(int type) {
/* 4935 */     return getPlayer().getHyPay(type);
   }







   public int addHyPay(int pay) {
/* 4945 */     return getPlayer().addHyPay(pay);
   }







   public int delPayReward(int pay) {
/* 4955 */     return getPlayer().delPayReward(pay);
   }













   public void makeitem(int id, short str, short dex, short ints, short luk, short watk, short matk, long period) {
/* 4971 */     makeitem(id, str, dex, ints, luk, watk, matk, period, 0);
   }

   public void setUserTimerInfo(int n, int n2, int n3, int n4, int n5) {
/* 4975 */     getClient().announce(MaplePacketCreator.LobbyTimeAction(n, n2, n3, n4, n5));
   }














   public void makeitem(int id, short str, short dex, short ints, short luk, short watk, short matk, long period, int state) {
/* 4992 */     makeitem(id, str, dex, ints, luk, watk, matk, period, state, "");
   }















   public void makeitem(int id, short str, short dex, short ints, short luk, short watk, short matk, long period, int state, String owner) {
/* 5010 */     if (!canHold(id) || !ItemConstants.isEquip(id)) {
/* 5011 */       playerMessage("装备栏空间不足或添加的道具不是装备");

       return;
     }
/* 5015 */     Equip equip = (Equip)MapleItemInformationProvider.getInstance().getEquipById(id);
/* 5016 */     equip.setStr(str);
/* 5017 */     equip.setDex(dex);
/* 5018 */     equip.setInt(ints);
/* 5019 */     equip.setLuk(luk);
/* 5020 */     equip.setWatk(watk);
/* 5021 */     equip.setMatk(matk);
/* 5022 */     equip.setExpiration(period);
/* 5023 */     equip.setState((byte)state, false);
/* 5024 */     if (!owner.isEmpty()) {
/* 5025 */       equip.setOwner(owner);
     }
/* 5027 */     equip.setGMLog("脚本获得 " + this.id + " (" + this.id2 + ") 地图: " + getPlayer().getMapId() + " 时间: " + DateUtil.getNowTime());
/* 5028 */     MapleInventoryManipulator.addbyItem(getC(), equip.copy());
   }




















   public void makeItem(int id, short str, short dex, short ints, short luk, short hp, short mp, short watk, short matk, short wdef, short mdef, short acc, short avoid, short hands, long period, int state, String owner) {
/* 5051 */     if (!canHold(id) || !ItemConstants.isEquip(id)) {
/* 5052 */       playerMessage("装备栏空间不足或添加的道具不是装备");

       return;
     }
/* 5056 */     Equip equip = (Equip)MapleItemInformationProvider.getInstance().getEquipById(id);
/* 5057 */     if (str > 0) {
/* 5058 */       equip.setStr(str);
     }
/* 5060 */     if (dex > 0) {
/* 5061 */       equip.setDex(dex);
     }
/* 5063 */     if (ints > 0) {
/* 5064 */       equip.setInt(ints);
     }
/* 5066 */     if (luk > 0) {
/* 5067 */       equip.setLuk(luk);
     }
/* 5069 */     if (hp > 0) {
/* 5070 */       equip.setHp(hp);
     }
/* 5072 */     if (mp > 0) {
/* 5073 */       equip.setMp(mp);
     }
/* 5075 */     if (watk > 0) {
/* 5076 */       equip.setWatk(watk);
     }
/* 5078 */     if (matk > 0) {
/* 5079 */       equip.setMatk(matk);
     }
/* 5081 */     if (wdef > 0) {
/* 5082 */       equip.setWdef(wdef);
     }
/* 5084 */     if (mdef > 0) {
/* 5085 */       equip.setMdef(mdef);
     }
/* 5087 */     if (acc > 0) {
/* 5088 */       equip.setAcc(acc);
     }
/* 5090 */     if (avoid > 0) {
/* 5091 */       equip.setAvoid(avoid);
     }
/* 5093 */     if (hands > 0) {
/* 5094 */       equip.setHands(hands);
     }
/* 5096 */     if (period > 0L) {
/* 5097 */       equip.setExpiration(period);
     }
/* 5099 */     if (state > 0) {
/* 5100 */       equip.setState((byte)state, false);
     }

/* 5103 */     if (!owner.isEmpty()) {
/* 5104 */       equip.setOwner(owner);
     }
/* 5106 */     equip.setGMLog("脚本获得 " + this.id + " (" + this.id2 + ") 地图: " + getPlayer().getMapId() + " 时间: " + DateUtil.getNowTime());
/* 5107 */     MapleInventoryManipulator.addbyItem(getC(), equip.copy());
   }

   public void getLobbyTime(int n2) {
/* 5111 */     String string = getPlayer().getOneInfo(42011, "tTime");
/* 5112 */     String string2 = getPlayer().getOneInfo(42011, "time");
/* 5113 */     if (string == null) {
/* 5114 */       string = "600000";
/* 5115 */       string2 = "600000";
     }
/* 5117 */     int n3 = Integer.valueOf(string).intValue();
/* 5118 */     int n4 = Integer.valueOf(string2).intValue();
/* 5119 */     getPlayer().send(MaplePacketCreator.LobbyTimeAction(n2, n4, n3));
   }

   public int isSocketDone(short s2) {
/* 5123 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 5124 */     Item item = getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(s2);
/* 5125 */     if (item != null) {
/* 5126 */       Equip equip = (Equip)item;
/* 5127 */       if (ii.isCash(equip.getItemId()) || ItemConstants.is饰品(equip.getItemId())) {
/* 5128 */         return 2;
       }
/* 5130 */       if (equip.getSocket1() >= 0 || (equip.getSocketState() & SocketFlag.已打孔01.getValue()) != 0) {
/* 5131 */         return 0;
       }
/* 5133 */       equip.setSocket1(0);
/* 5134 */       getPlayer().forceUpdateItem((Item)equip);
/* 5135 */       return 1;
     }
/* 5137 */     return -1;
   }

   public void startQuestTimeLimitTask(int n2, int n3) {
/* 5141 */     getPlayer().startQuestTimeLimitTask(n2, n3);
   }

   public void setForcedAction(int n2, int n3) {
/* 5145 */     getC().announce(UIPacket.getDirectionEffect(0, null, n2, n3, 0, 0, 0, 0, 0, 0));
   }






   public void setDelay(int second) {
/* 5154 */     getC().announce(UIPacket.getDirectionEffect(1, null, second * 1000, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setEffectPlay(String string, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9) {
/* 5158 */     getC().announce(UIPacket.getDirectionEffect(2, string, n2, n3, n4, n5, n6, n7, n8, n9));
   }

   public void setForcedInput(int n2) {
/* 5162 */     getC().announce(UIPacket.getDirectionEffect(3, null, n2, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setPatternInputRequest(String string, int n2, int n3, int n4) {
/* 5166 */     getC().announce(UIPacket.getDirectionEffect(4, string, n2, n3, n4, 0, 0, 0, 0, 0));
   }

   public void setCameraMove(int n2, int n3, int n4, int n5) {
/* 5170 */     getC().announce(UIPacket.getDirectionEffect(5, null, n2, n3, n4, n5, 0, 0, 0, 0));
   }

   public void setCameraOnCharacter(int n2) {
/* 5174 */     getC().announce(UIPacket.getDirectionEffect(6, null, n2, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setCameraZoom(int n2, int n3, int n4, int n5, int n6) {
/* 5178 */     getC().announce(UIPacket.getDirectionEffect(7, null, n2, n3, n4, n5, n6, 0, 0, 0));
   }

   public void setCameraReleaseFromUserPoint() {
/* 5182 */     getC().announce(UIPacket.getDirectionEffect(8, null, 0, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setVansheeMode(int n2) {
/* 5186 */     getC().announce(UIPacket.getDirectionEffect(10, null, n2, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setFaceOff(int n2) {
/* 5190 */     getC().announce(UIPacket.getDirectionEffect(11, null, n2, 0, 0, 0, 0, 0, 0, 0));
   }







   public void setMonologue(String string, int n2) {
/* 5200 */     getC().announce(UIPacket.getDirectionEffect(12, string, n2, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setMonologueScroll(String string, int n2, int n3, int n4, int n5) {
/* 5204 */     getC().announce(UIPacket.getDirectionEffect(13, null, n2, n3, n4, n5, 0, 0, 0, 0));
   }


   public void setAvatarLookSet(short s2) {}

   public void setRemoveAdditionalEffect() {
/* 5211 */     getC().announce(UIPacket.getDirectionEffect(15, null, 0, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setForcedMove(int n2, int n3) {
/* 5215 */     getC().announce(UIPacket.getDirectionEffect(16, null, n2, n3, 0, 0, 0, 0, 0, 0));
   }

   public void setForcedFlip(int n2) {
/* 5219 */     getC().announce(UIPacket.getDirectionEffect(17, null, n2, 0, 0, 0, 0, 0, 0, 0));
   }

   public void setInputUI(int n2) {
/* 5223 */     getC().announce(UIPacket.getDirectionEffect(18, null, n2, 0, 0, 0, 0, 0, 0, 0));
   }




   public void show5thJobEffect() {
/* 5230 */     getC().announce(MaplePacketCreator.environmentChange("Effect/5skill.img/screen", BossEffectOpcode.RewordRullet.getValue(), 0));
/* 5231 */     getC().announce(MaplePacketCreator.environmentChange("Sound/SoundEff.img/5thJobd", BossEffectOpcode.Sound.getValue(), 100));
/* 5232 */     TutInstructionalBalloon("Effect/5skill.img/character_delayed");
   }

   public void setLTime() {
/* 5236 */     getPlayer().setLTime();
   }

   public void gainVCraftCore(int n2) {
/* 5240 */     getPlayer().gainVCraftCore(n2);
   }







   public void showCombustionMessage(String message, int second) {
/* 5250 */     getClient().announce(EffectPacket.showCombustionMessage(message, second));
   }

   public int getNewInstanceMapId() {
/* 5254 */     return EventScriptManager.getNewInstanceMapId();
   }








   public List<Map<String, Object>> sql_Select(String sql, Object... data) {
/* 5265 */     return DatabaseScriptAPI.SQLSelect(sql, data);
   }








   public int sql_Insert(String sql, Object... data) {
/* 5276 */     return DatabaseScriptAPI.SQLInsert(sql, data);
   }








   public int sql_Update(String sql, Object... data) {
/* 5287 */     return DatabaseScriptAPI.SQLUpdate(sql, data);
   }

   public void showScreenEffect(String s) {
/* 5291 */     getPlayer().showScreenEffect(s);
   }

   public final void showScreenEffect(int opcode, String effect, int n2) {
/* 5295 */     if (getClient() != null) {
/* 5296 */       getClient().announce(MaplePacketCreator.showSceenEffect(opcode, effect, n2));
     }
   }

   public void showScreenDelayedEffect(String s, int n) {
/* 5301 */     getPlayer().showScreenDelayedEffect(s, n);
   }

   public void showScreenAutoLetterBox(String s, int n) {
/* 5305 */     getPlayer().showScreenAutoLetterBox(s, n);
   }

   public void broadcastScreenEffect(String s) {
/* 5309 */     broadcastScreenEffect(FieldEffectOpcode.Screen_Delayed.getValue(), s, 0);
   }

   public void broadcastScreenEffect(int n, String s, int n2) {
/* 5313 */     getMap().broadcastMessage(MaplePacketCreator.showSceenEffect(n, s, 0));
   }






   public void setInGameCurNodeEventEnd(boolean enable) {
/* 5322 */     getDirectionStatus(enable);
   }

   public void showWeatherEffectNotice(String s, int n, int n2) {
/* 5326 */     getMap().showWeatherEffectNotice(s, n, n2);
   }

   public void showSystemMessage(String s) {
/* 5330 */     MapleClient client = getClient();
/* 5331 */     client.announce(UIPacket.showSystemMessage(s));
   }

   public void teleport(int n) {
/* 5335 */     teleport(0, n, null);
   }

   public void teleport(int n, int n2, Point point) {
/* 5339 */     getClient().announce(MaplePacketCreator.instantMapWarp(false, n, n2, point));
   }






   public void spawnFallingDrop(int itemid) {
/* 5348 */     getMap().spawnFallingDrop(itemid);
   }






   public String getChatColor() {
/* 5357 */     return ServerConstants.ChatColor.getChatColor(getPlayer().getChatColor());
   }






   public void setChatColor(String color) {
/* 5366 */     getPlayer().setChatColor(color);
   }






   public List<String> getAllChatColor() {
/* 5375 */     List<String> ret = new LinkedList<>();
/* 5376 */     for (ServerConstants.ChatColor chatColor : ServerConstants.ChatColor.values()) {
/* 5377 */       ret.add(chatColor.name());
     }
/* 5379 */     return ret;
   }







   public short getNumFreeSlot(byte type) {
/* 5389 */     return getPlayer().getSpace(type);
   }









   public void setInGameDirectionMode(boolean b, boolean b2, boolean b3, boolean b4) {
/* 5401 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 5402 */     mplew.writeShort(SendPacketOpcode.INTRO_LOCK_MOVIE.getValue());
/* 5403 */     mplew.writeBool(b);
/* 5404 */     mplew.writeBool(b2);
/* 5405 */     if (b) {
/* 5406 */       mplew.writeBool(b3);
/* 5407 */       mplew.writeBool(b4);
     }
/* 5409 */     getClient().announce(mplew.getPacket());
   }







   public void showTrembleEffect(boolean tremble, int type) {
/* 5419 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 5421 */     mplew.writeShort(SendPacketOpcode.BOSS_ENV.getValue());
/* 5422 */     mplew.write(FieldEffectOpcode.Tremble.getValue());
/* 5423 */     mplew.writeBool(tremble);
/* 5424 */     mplew.writeInt(type);
/* 5425 */     mplew.writeShort(30);
/* 5426 */     getClient().announce(mplew.getPacket());
   }


   public void showUserEffect(boolean 全图玩家, short mode, Object... Data) {
     byte[] packet;
/* 5432 */     switch (mode) {
       case 0:
/* 5434 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_LevelUp, Data);
         break;
       case 1:
/* 5437 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillUse, Data);
         break;
       case 2:
/* 5440 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillUseBySummoned, Data);
         break;
       case 3:
/* 5443 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillUseBy_unk0x3, Data);
         break;
       case 4:
/* 5446 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillAffected, Data);
         break;
       case 5:
/* 5449 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillAffected_Ex, Data);
         break;
       case 6:
/* 5452 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillAffected_Select, Data);
         break;
       case 7:
/* 5455 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillSpecialAffected, Data);
         break;
       case 8:
/* 5458 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Quest, Data);
         break;
       case 9:
/* 5461 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Pet, Data);
         break;
       case 10:
/* 5464 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillSpecial, Data);
         break;
       case 11:
/* 5467 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Resist, Data);
         break;
       case 12:
/* 5470 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ProtectOnDieItemUse, Data);
         break;
       case 13:
/* 5473 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PlayPortalSE, Data);
         break;
       case 14:
/* 5476 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_JobChanged, Data);
         break;
       case 15:
/* 5479 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_QuestComplete, Data);
         break;
       case 16:
/* 5482 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_IncDecHPEffect, Data);
         break;
       case 17:
/* 5485 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BuffItemEffect, Data);
         break;
       case 18:
/* 5488 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SquibEffect, Data);
         break;
       case 19:
/* 5491 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_MonsterBookCardGet, Data);
         break;
       case 20:
/* 5494 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_LotteryUse, Data);
         break;
       case 21:
/* 5497 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ItemLevelUp, Data);
         break;
       case 22:
/* 5500 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ItemMaker, Data);
         break;
       case 23:
/* 5503 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ItemUnk0x17, Data);
         break;
       case 24:
/* 5506 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ExpItemConsumed, Data);
         break;
       case 25:
/* 5509 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_FieldExpItemConsumed, Data);
         break;
       case 26:
/* 5512 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ReservedEffect, Data);
         break;
       case 27:
/* 5515 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_UpgradeTombItemUse, Data);
         break;
       case 28:
/* 5518 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BattlefieldItemUse, Data);
         break;
       case 29:
/* 5521 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_AvatarOriented, Data);
         break;
       case 30:
/* 5524 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_AvatarOrientedRepeat, Data);
         break;
       case 31:
/* 5527 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_AvatarOrientedMultipleRepeat, Data);
         break;
       case 32:
/* 5530 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_IncubatorUse, Data);
         break;
       case 33:
/* 5533 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PlaySoundWithMuteBGM, Data);
         break;
       case 34:
/* 5536 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PlayExclSoundWithDownBGM, Data);
         break;
       case 35:
/* 5539 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SoulStoneUse, Data);
         break;
       case 36:
/* 5542 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_IncDecHPEffect_EX, Data);
         break;
       case 37:
/* 5545 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_IncDecHPRegenEffect, Data);
         break;
       case 38:
/* 5548 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_EffectUOL, Data);
         break;
       case 39:
/* 5551 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_EffectUNK0x27, Data);
         break;
       case 40:
/* 5554 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PvPChampion, Data);
         break;
       case 41:
/* 5557 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PvPGradeUp, Data);
         break;
       case 42:
/* 5560 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PvPRevive, Data);
         break;
       case 43:
/* 5563 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_JobEffect, Data);
         break;
       case 44:
/* 5566 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_FadeInOut, Data);
         break;
       case 45:
/* 5569 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_MobSkillHit, Data);
         break;
       case 46:
/* 5572 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_EffectUNK0x2E, Data);
         break;
       case 47:
/* 5575 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_AswanSiegeAttack, Data);
         break;
       case 48:
/* 5578 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BlindEffect, Data);
         break;
       case 49:
/* 5581 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BossShieldCount, Data);
         break;
       case 50:
/* 5584 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ResetOnStateForOnOffSkill, Data);
         break;
       case 51:
/* 5587 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_JewelCraft, Data);
         break;
       case 52:
/* 5590 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ConsumeEffect, Data);
         break;
       case 53:
/* 5593 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PetBuff, Data);
         break;
       case 54:
/* 5596 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_LotteryUIResult, Data);
         break;
       case 55:
/* 5599 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_LeftMonsterNumber, Data);
         break;
       case 56:
/* 5602 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ReservedEffectRepeat, Data);
         break;
       case 57:
/* 5605 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_RobbinsBomb, Data);
         break;
       case 58:
/* 5608 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillMode, Data);
         break;
       case 59:
/* 5611 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_ActQuestComplete, Data);
         break;
       case 60:
/* 5614 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Point, Data);
         break;
       case 61:
/* 5617 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SpeechBalloon, Data);
         break;
       case 62:
/* 5620 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_TextEffect, Data);
         break;
       case 63:
/* 5623 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_SkillPreLoopEnd, Data);
         break;

       case 64:
/* 5627 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Aiming, Data);
         break;
       case 65:
/* 5630 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_UNK0x40, Data);
         break;
       case 66:
/* 5633 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_PickUpItem, Data);
         break;
       case 67:
/* 5636 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BattlePvP_IncDecHp, Data);
         break;
       case 68:
/* 5639 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BiteAttack_ReceiveSuccess, Data);
         break;
       case 69:
/* 5642 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BiteAttack_ReceiveFail, Data);
         break;
       case 70:
/* 5645 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BiteAttack_Unk0x45, Data);
         break;
       case 71:
/* 5648 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_BiteAttack_Unk0x46, Data);
         break;
       case 72:
/* 5651 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.HakuSkillEffect, Data);
         break;
       case 73:
/* 5654 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_0x48, Data);
         break;
       case 74:
/* 5657 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_0x49, Data);
         break;
       case 75:
/* 5660 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_0x4A, Data);
         break;
       case 76:
/* 5663 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x4B, Data);
         break;
       case 77:
/* 5666 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.BatteryON, Data);
         break;
       case 78:
/* 5669 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.BatteryOFF, Data);
         break;
       case 79:
/* 5672 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x4E, Data);
         break;
       case 80:
/* 5675 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x4F, Data);
         break;
       case 81:
/* 5678 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x50, Data);
         break;
       case 82:
/* 5681 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x51, Data);
         break;
       case 83:
/* 5684 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x52, Data);
         break;
       case 84:
/* 5687 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x53, Data);
         break;
       case 85:
/* 5690 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x54, Data);
         break;
       case 86:
/* 5693 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x55, Data);
         break;
       case 87:
/* 5696 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x56, Data);
         break;
       case 88:
/* 5699 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x57, Data);
         break;
       case 89:
/* 5702 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x58, Data);
         break;
       case 90:
/* 5705 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x59, Data);
         break;
       case 91:
/* 5708 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x5A, Data);
         break;
       case 92:
/* 5711 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_Unk0x5B, Data);
         break;

       default:
/* 5715 */         packet = LP_UserEffectLocal.LP_UserEffectLocal(EffectOpcode.UserEffect_JobEffect, Data);
         break;
     }



/* 5721 */     if (全图玩家) {
/* 5722 */       getPlayer().getMap().broadcastMessage(packet);
     } else {
/* 5724 */       getClient().announce(packet);
     }
   }



   public void showUserEffect(short type, Object... Data) {
/* 5731 */     for (EffectOpcode op : EffectOpcode.values()) {
/* 5732 */       if (op.getValue() == type) {
/* 5733 */         getClient().announce(LP_UserEffectLocal.LP_UserEffectLocal(op, Data));
       }
     }
   }














   public void showFieldEffect(boolean 全图玩家, short mode, Object... Data) {
     byte[] packet;
/* 5753 */     switch (mode) {
       case 1:
/* 5755 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Summon, Data);
         break;
       case 2:
/* 5758 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Object, Data);
         break;
       case 3:
/* 5761 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Screen, Data);
         break;
       case 4:
/* 5764 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.TopScreen, Data);
         break;
       case 5:
/* 5767 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_24, Data);
         break;
       case 6:
/* 5770 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_22, Data);
         break;
       case 7:
/* 5773 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Object_Disable, Data);
         break;
       case 8:
/* 5776 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.TopScreen_WithOrigin, Data);
         break;
       case 9:
/* 5779 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Sound, Data);
         break;
       case 10:
/* 5782 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Screen_Delayed, Data);
         break;
       case 11:
/* 5785 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.TopScreen_Delayed, Data);
         break;
       case 12:
/* 5788 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Screen_AutoLetterBox, Data);
         break;
       case 13:
/* 5791 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_25, Data);
         break;

       case 14:
/* 5795 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.MobHPTag, Data);
         break;
       case 15:
/* 5798 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.ChangeBGM, Data);
         break;
       case 16:
/* 5801 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.BGMVolumeOnly, Data);
         break;
       case 17:
/* 5804 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.BGMVolume, Data);
         break;
       case 18:
/* 5807 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_10, Data);
         break;
       case 19:
/* 5810 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_11, Data);
         break;
       case 20:
/* 5813 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_13, Data);
         break;
       case 21:
/* 5816 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Overlap, Data);
         break;
       case 22:
/* 5819 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Remove_Overlap_Detail, Data);
         break;
       case 23:
/* 5822 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.StageClear, Data);
         break;
       case 24:
/* 5825 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_12, Data);
         break;
       case 25:
/* 5828 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_14, Data);
         break;
       case 26:
/* 5831 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Tremble, Data);
         break;
       case 27:
/* 5834 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.RewordRullet, Data);
         break;
       case 28:
/* 5837 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.FloatingUI, Data);
         break;
       case 29:
/* 5840 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Blind, Data);
         break;
       case 30:
/* 5843 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.GrayScale, Data);
         break;
       case 31:
/* 5846 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.ColorChange, Data);
         break;
       case 32:
/* 5849 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Overlap_Detail, Data);
         break;
       case 33:
/* 5852 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.SpineScreen, Data);
         break;
       case 34:
/* 5855 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.OffSpineScreen, Data);
         break;
       case 35:
/* 5858 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_26, Data);
         break;
       case 36:
/* 5861 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.OnOffLayer, Data);
         break;

       default:
/* 5865 */         packet = LP_FieldEffect.LP_UserEffectLocal(BossEffectOpcode.Unknow_12, Data);
         break;
     }

/* 5869 */     if (全图玩家) {
/* 5870 */       getPlayer().getMap().broadcastMessage(packet);
     } else {
/* 5872 */       getClient().announce(packet);
     }
   }














   public void showFieldEffect(short type, Object... Data) {
/* 5890 */     for (BossEffectOpcode op : BossEffectOpcode.values()) {
/* 5891 */       if (op.getValue() == type) {
/* 5892 */         getClient().announce(LP_FieldEffect.LP_UserEffectLocal(op, Data));
       }
     }
   }

   public void showAvatarOriented(String data) {
/* 5898 */     getClient().announce(EffectPacket.AranTutInstructionalBalloon(data));
   }

   public void showAvatarOrientedRepeat(boolean b, String s) {
/* 5902 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 5904 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 5905 */     mplew.write(EffectOpcode.UserEffect_AvatarOrientedRepeat.getValue());
/* 5906 */     mplew.writeBool(b);
/* 5907 */     if (b) {
/* 5908 */       mplew.writeMapleAsciiString(s);
/* 5909 */       mplew.writeInt(0);
/* 5910 */       mplew.writeInt(1);
     }
/* 5912 */     getClient().announce(mplew.getPacket());
   }

   public boolean checkMapleUnion() {
/* 5916 */     if (getPlayer().getMapleUnion().getTotalLevel() >= 60) {
/* 5917 */       int questid = 18771;


/* 5920 */       if (!isQuestFinished(16013) || getPlayer().getOneInfo(questid, "rank") == null) {

/* 5922 */         forceCompleteQuest(16013);

         String rank;

/* 5926 */         if ((rank = getPlayer().getOneInfo(questid, "rank")) == null) {
/* 5927 */           rank = "101";
         }

/* 5930 */         getPlayer().updateOneQuestInfo(questid, "rank", rank);

/* 5932 */         getPlayer().getMapleUnion().setRank(Integer.valueOf(rank).intValue());
/* 5933 */         getPlayer().getMapleUnion().update();
/* 5934 */         getClient().announce(MaplePacketCreator.UpdateMapleUnion(getPlayer().getMapleUnion()));
       }
/* 5936 */       return true;
     }
/* 5938 */     return false;
   }






   public int getMapleUnionMaxLevel() {
/* 5947 */     return MapleUnionFactory.INSTANCE.getUnionRank().size();
   }

   public int getMapleUnionLevel() {
/* 5951 */     MapleUnion mapleUnion = getPlayer().getMapleUnion();
/* 5952 */     if (mapleUnion != null) {
/* 5953 */       return mapleUnion.getTotalLevel();
     }
/* 5955 */     return 0;
   }

   public UnionRankEntry getMapleUnionRank() {
/* 5959 */     MapleUnionFactory mapleUnionFactory = MapleUnionFactory.INSTANCE;

/* 5961 */     int rank, n = (rank = getPlayer().getMapleUnion().getRank()) / 100;
/* 5962 */     int n2 = rank % 10;
/* 5963 */     UnionRankEntry unionRankEntry = null;
/* 5964 */     if (mapleUnionFactory.getUnionRank().containsKey(Integer.valueOf(n)) && ((HashMap)mapleUnionFactory.getUnionRank().get(Integer.valueOf(n))).containsKey(Integer.valueOf(n2))) {
/* 5965 */       unionRankEntry = (UnionRankEntry)((HashMap)mapleUnionFactory.getUnionRank().get(Integer.valueOf(n))).get(Integer.valueOf(n2));
     }
/* 5967 */     return unionRankEntry;
   }

   public UnionRankEntry getNextMapleUnionRank() {
/* 5971 */     MapleUnionFactory mapleUnionFactory = MapleUnionFactory.INSTANCE;

/* 5973 */     int ck, n = (ck = getPlayer().getMapleUnion().getRank()) / 100;
/* 5974 */     int n2 = ck % 10;
/* 5975 */     UnionRankEntry unionRankEntry = null;
/* 5976 */     if (mapleUnionFactory.getUnionRank().containsKey(Integer.valueOf(n)) && ((HashMap)mapleUnionFactory.getUnionRank().get(Integer.valueOf(n))).containsKey(Integer.valueOf(n2))) {
/* 5977 */       if (n2 < ((HashMap)mapleUnionFactory.getUnionRank().get(Integer.valueOf(n))).size()) {
/* 5978 */         unionRankEntry = (UnionRankEntry)((HashMap)mapleUnionFactory.getUnionRank().get(Integer.valueOf(n))).get(Integer.valueOf(n2 + 1));
/* 5979 */       } else if (n < mapleUnionFactory.getUnionRank().size()) {
/* 5980 */         unionRankEntry = (UnionRankEntry)((HashMap)mapleUnionFactory.getUnionRank().get(Integer.valueOf(n + 1))).get(Integer.valueOf(1));
       }
     }
/* 5983 */     return unionRankEntry;
   }




   public boolean doMapleUnionLevelUp() {
/* 5990 */     UnionRankEntry nextMapleUnionRank = getNextMapleUnionRank();
/* 5991 */     if (nextMapleUnionRank != null && getMapleUnionLevel() >= nextMapleUnionRank.getLevel()) {
/* 5992 */       int rank = nextMapleUnionRank.getRank() * 100 + nextMapleUnionRank.getSubRank();
/* 5993 */       getPlayer().getMapleUnion().setRank(rank);
/* 5994 */       updateOneQuestInfo(18771, "rank", String.valueOf(rank));
/* 5995 */       getPlayer().getMapleUnion().update();
/* 5996 */       getClient().announce(MaplePacketCreator.UpdateMapleUnion(getPlayer().getMapleUnion()));
/* 5997 */       return true;
     }
/* 5999 */     return false;
   }

   public void playFieldSound(String sound) {
/* 6003 */     getMap().playFieldSound(sound);
   }

   public void setObjectState(String state) {
/* 6007 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 6008 */     mplew.writeShort(SendPacketOpcode.BOSS_ENV.getValue());
/* 6009 */     mplew.write(FieldEffectOpcode.Object.getValue());
/* 6010 */     mplew.writeMapleAsciiString(state);
/* 6011 */     getMap().broadcastMessage(mplew.getPacket());
   }







   public void updateTowerRank(int stage, int time) {
/* 6021 */     try(DruidPooledConnection con = DatabaseConnection.getInstance().getConnection(); 
/* 6022 */         PreparedStatement ps = con.prepareStatement("SELECT * FROM `zrank_lobby` WHERE `world` = ? AND `characters_id` = ?")) {
/* 6023 */       ps.setInt(1, getClient().getWorld());
/* 6024 */       ps.setInt(2, getPlayer().getId());
/* 6025 */       try (ResultSet rs = ps.executeQuery()) {
/* 6026 */         if (rs.next()) {
/* 6027 */           try (PreparedStatement pss = con.prepareStatement("UPDATE `zrank_lobby` SET `stage` = ?, `time` = ? WHERE `world` = ? AND `characters_id` = ? AND ((`stage` < ? OR (`stage` = ? AND `time` > ?)) OR (`logtime` < ?))")) {
/* 6028 */             pss.setInt(1, stage);
/* 6029 */             pss.setInt(2, time);
/* 6030 */             pss.setInt(3, getClient().getWorld());
/* 6031 */             pss.setInt(4, getPlayer().getId());
/* 6032 */             pss.setInt(5, stage);
/* 6033 */             pss.setInt(6, stage);
/* 6034 */             pss.setInt(7, time);
/* 6035 */             pss.setLong(8, DateUtil.getTuesDay().getTime());

/* 6037 */             pss.executeUpdate();
           }
         } else {
/* 6040 */           try (PreparedStatement pss = con.prepareStatement("INSERT INTO `zrank_lobby` (`world`, `characters_id`, `characters_name`, `stage`, `time`)VALUES (?, ?, ?, ?, ?)")) {
/* 6041 */             pss.setInt(1, getClient().getWorld());
/* 6042 */             pss.setInt(2, getPlayer().getId());
/* 6043 */             pss.setString(3, getName());
/* 6044 */             pss.setInt(4, stage);
/* 6045 */             pss.setInt(5, time);
/* 6046 */             pss.executeUpdate();
           }

         }
       }
/* 6051 */     } catch (SQLException e) {
/* 6052 */       log.error("updateTowerRank 发生错误", e);
     }
   }






   public void setStandAloneMode(boolean enabled) {
/* 6062 */     if (enabled) {
/* 6063 */       EnableUI((short)1, true);
     } else {
/* 6065 */       DisableUI(enabled);
     }
   }







   public void setLayerBlind(boolean enable, int shade) {
/* 6076 */     getClient().announce(UIPacket.setLayerBlind(enable, shade, 0));
   }







   public String HttpDoGet(String httpUrl) {
/* 6086 */     return HttpUtil.doGet(httpUrl);
   }









   public String HttpDoPost(String httpUrl, String param, String contentType) {
/* 6098 */     return HttpUtil.doPost(httpUrl, param, contentType);
   }









   public String HttpDoPostForm(String httpUrl, Map<String, String> param, String contentType) {
/* 6110 */     return HttpUtil.doPostForm(httpUrl, param, contentType);
   }










   public void GiveStarReward(int itemid, int quantity, int period, int days, String msg) {
/* 6123 */     long nowTime = System.currentTimeMillis();
/* 6124 */     Timestamp startTime = new Timestamp(nowTime);
/* 6125 */     Timestamp endTime = new Timestamp(nowTime + (days * 24 * 60 * 60 * 1000));

/* 6127 */     StarReward starReward = new StarReward(itemid, quantity, period, startTime, endTime, msg);
/* 6128 */     StarReward.getInstance().addStarRewardInfo(getChar(), starReward);
   }

   public void showDimensionMirror() {
/* 6132 */     List<DimensionalMirror> list = new ArrayList<>();
     DimensionalMirror[] values;
/* 6134 */     for (int length = (values = DimensionalMirror.values()).length, i = 0; i < length; i++) {
       DimensionalMirror l;
/* 6136 */       if ((l = values[i]).getMapID() > 0) {
/* 6137 */         list.add(l);
       }
     }
/* 6140 */     getClient().announce(UIPacket.showDimensionalMirror(list));
   }







   public void showItemMessage(int itemId, String msg) {
/* 6150 */     getClient().announce(UIPacket.ScriptProgressItemMessage(itemId, msg));
   }




   public void openSupportSystemUI() {
/* 6157 */     getClient().announce(UIPacket.SupportSystemUI());
   }







   public void openWebUI(String wzBackgrnd, String url) {
/* 6167 */     getClient().announce(UIPacket.openWebUI(wzBackgrnd, url));
   }
 }


/* Location:              C:\PGX\Server.jar!\scripting\AbstractPlayerInteraction.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */